Dollar-sign expansion using parameters
Parameters can be used in dollar-sign expansions. The variable must then contain formal parameters, such as
Example:
Set MUL=’$1*$2’;
Set
X=$(MUL(3,7)); // returns '
Let
X=$(MUL(3,7)); // returns
If the number of formal parameters exceeds the number of actual parameters only the formal parameters corresponding to actual parameters will be expanded. If the number of actual parameters exceeds the number of formal parameters the superfluous actual parameters will be ignored.
Example:
Set MUL=’$1*$2’;
Set
X=$(MUL); // returns '
Set
X=$(MUL(10)); // returns '
Let
X=$(MUL(5,7,8)); // returns
The parameter
Example:
set MUL='$1*$2 $0 par';
set
X=$(MUL(3,7)); // returns '