Direct Assignment of Macro Variables (DEFINE-!ENDDEFINE command)
The macro command !LET
assigns values to macro variables. The syntax is as follows:
!LET !var = expression
- The expression must be either a single token or enclosed in parentheses.
- The macro variable !var cannot be a macro keyword, and it cannot be the name of one of the
arguments within the macro definition. Thus,
!LET
cannot be used to change the value of an argument. - The macro variable !var can be a new variable or one previously assigned by a
!DO
command or another!LET
command.
Example
!LET !a = 1
!LET !b = !CONCAT(ABC,!SUBSTR(!1,3,1),DEF)
!LET !c = (!2 ~= !NULL)
- The first
!LET
sets !a equal to 1. - The second
!LET
sets !b equal to ABC followed by 1 character taken from the third position of!1
followed by DEF. - The last
!LET
sets !c equal to 0 (false) if!2
is a null string or to 1 (true) if!2
is not a null string.