ASFUNCTION
When you run a functional map with the ASFUNCTION function, the output of the functional map returns to the map rule that invoked the functional map. The invoking rule can work with the output from the functional map. The type of the output card must be an item.
Without ASFUNCTION, a functional map writes to the output card before the rest of the invoking rule is evaluated.
If ASFUNCTION runs a functional map that calls a second functional map, the output of the second map also returns to the map rule, as if the second map had been invoked by ASFUNCTION. If the output of each map is a number and the outputs are concatenated, ASFUNCTION adds the numbers instead of concatenating them.
- Syntax:
- ASFUNCTION ( general-expression)
- Meaning:
- ASFUNCTION (FunctionalMapName ( argument-1 , argument-2 , ... argument-n ))
- Returns:
- item
Example 1
Output_name = FMAP1 (rule) + " and " + Fmap2 (rule) + "."
Output_of_FMap1Output_of_FMap2 and .
Output_name = ASFUNCTION(FMAP1 (rule)) + " and " + Fmap2 (rule) + "."
Output_of_FMap1 and Output_of_FMap2.
Example 2
Output_name = IF (FMap1 (rule) = "abc", "equal", "not equal")
- If FMap1 produces abc:
abcnot equal
- If FMap1 produces def:
defnot equal
Output_name = ASFUNCTION(IF (FMap1 (rule) = "abc", "equal", "not equal"))
- If FMap1 produces abc:
equal
- If FMap1 produces def:
not equal
Example 3
Output_name = ASFUNCTION(FMAP1(rule1)) + FMAP2(rule2)
- If FMAP1 produces 1 and FMAP2 produces 2:
3
- If FMAP1 produces A and FMAP2 produces B:
AB