TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-21
#ARGUMENT Built-In Function
#ARGUMENT Built-In Function
Use #ARGUMENT to parse the arguments passed to a routine. #ARGUMENT returns
the position number (in the list of alternatives to #ARGUMENT) of the alternative that
matches the type of the routine argument being examined. You can specify up to eight
alternatives to #ARGUMENT.
Each call to #ARGUMENT implicitly moves an internal pointer (called the current
position) through the list of the routine arguments, unless the PEEK option is used.
The current position can be obtained by #GETSCAN and can be changed with
#SETSCAN or with the START option of the CHARACTERS alternative.
Alternatives are tested, in the order supplied, against the routine argument at the
current position. When an alternative is satisfied, no further alternatives are tried. If
none of the supplied alternatives can be satisfied, the TACL error handler takes over.
option
is any of these:
PEEK
prevents #ARGUMENT from moving the current position. The operation of
#ARGUMENT is normal in all other ways; in particular, if no matching type is
supplied, an error is still generated.
TEXT variable-level
specifies the name of an existing variable level that is to receive an exact copy
(except that leading and trailing spaces and blank lines are suppressed) of the
portion of the argument sequence that was processed in the call to
#ARGUMENT.
If the call to the routine is issued from an IN file or is loaded under control of a
?FORMAT directive in a library file, the setting of the #INFORMAT built-in
variable affects how TACL copies the text. If, for example, TACL is using
PLAIN format, TACL does not recognize square brackets as metacharacters.
VALUE variable-level
specifies the name of an existing variable level that is to receive the TACL
interpretation of the portion of the argument sequence that was processed in
the call to #ARGUMENT. This interpretation can be different from what is
obtained by the TEXT option, depending on the argument type and its options.
If the call to the routine is issued from an IN file or is loaded under control of a
?FORMAT directive in a library file, the setting of the #INFORMAT built-in
variable affects how TACL interprets the argument portion. If, for example,
#ARGUMENT [ / option [ , option ] ... / ]
alternative [ alternative ] ...