A parameter can be either a simple string or a quoted string. It can be passed by using the standard method of putting variables into shared and profile pools (use VPUT in dialogs and VGET in initial macros). This method is best suited to parameters passed from one dialog to another, as in an edit macro.
You can enter parameters along with an edit macro name as a primary command by using the MACRO command. This command allows you to identify the names of one or more variables to contain any passed parameters.
For more information, see Working with an edit line command table.
It is an error to enter parameter values for a macro without parameter variables. If you make this mistake, the editor displays a message. It is not an error if you supply more or fewer parameters than the number of variables that are included on the MACRO command. When you are writing a macro, check for omissions and the order of parameters.
Multiple parameters are placed into one or more variables based on the number of variables specified in the MACRO command. If you include more than one variable name, the editor stores the parameters in order (the first parameter in the first variable, the second in the second, and so on). Note that assignment to variables is by position only.
If there are more parameters entered than there are variables available, the editor stores the remaining parameters as 1 character string in the last variable. If you include only one variable name on the MACRO command, that variable contains all the parameters entered with the macro name. If there are more variable names than parameters, the unused variables are set to nulls.
| CLIST Statement | REXX Statements |
|---|---|
|
|
FIXIT GOOD BAD AND UGLY
variable
PARM1 is assigned the value "GOOD", PARM2 is assigned the value "BAD",
and REST is assigned the value "AND UGLY".FIXIT 'GOOD BAD' 'AND UGLY'
PARM1 would
be set to "GOOD BAD", PARM2 would be set to "AND UGLY",
and REST would be null.ISRTRYIT RESET
sets the variables command to "RESET" and parm to
null. Conversely, this command: ISRTRYIT FIND A
sets command to "FIND" and parm to "A". To find out what was actually typed on the command
line, a macro may examine the variable ZEDITCMD, which is in the shared
variable pool. ZEDITCMD is a character variable, the length if which
depends on the length of the command entered. Therefore, you should
either VDEFINE ZEDITCMD to be sufficiently large to hold the expected
command, or use the VCOPY service to get the length.