Command Line Functions
The $FARGC Function
Returns count of arguments Returns: Numeric |
The $FARGC function returns the number of arguments in the GENER command line (as can be found in the $PARAM macro variable). If a param string is given, the $FARGC function will instead return the number of arguments contained within the param string. The sep string contains the character used as the argument separator. The default value for the separator is a blank. When using a blank as a separator, those within matching
"quote characters are not treated as separators.
The $FARGV Function
Returns nth argument Returns: Numeric |
The $FARGV function extracts the nth argument of the GENER command line (as can be found in the $PARAM macro variable). If a param string is given, the $FARGV function will instead extract the argument from this string. The sep string contains the character used as the argument separator. The default value for the separator is a blank. When using a blank as a separator, those within matching
"quote characters are not treated as separators.
The $FPNAME and $FPVALUE Functions
Return name portion of command line qualifier Returns: String |
|
Return value portion of command line qualifier Returns: String |
The $FPNAME function returns the parameter name portion of a command line qualifier stored in the param string. The $FPVALUE function returns the parameter value portion. These functions are intended to work with the results of the $FARGV function described above. Command line qualifiers take the following form:
/name=valueFor example, calling
$FPNAME('/ABC="D E F"')returns the stringABC, whereas calling$FPVALUE('/ABC="D E F"')returns the stringD E F. If the input string does not contain a / delimited qualifier, then a blank string is returned for the parameter name function and the entire string is returned for the parameter value function.The following example will list all of the command line arguments passed to GENER:
DO/I=1,$FARGC() STR=$FARGV(I) PPRINT/'!(*): Name "!(*)", Value "!(*)"',I,$FPNAME(STR),$FPVALUE(STR) ENDOF/DO