Processing Arguments
Developing TACL Routines
3–4
107365 Tandem Computers Incorporated
File names (FILENAME), DEFINE names and attribute names (DEFINENAME
and ATTRIBUTENAME), process names (PROCESSNAME), system names
(SYSTEMNAME), and user names (USER)
Subsystem IDs (SUBSYSTEM) and text for SPI and EMS tokens (TOKEN)
Some alternatives allow you to limit processing to syntax checking. For example, the
FILENAME alternative looks for the name of an existing file. If, however, you specify
FILENAME /SYNTAX/, the #ARGUMENT built-in function searches for a file name
that is formatted correctly; it does not check for the existence of the file.
If an argument does not match any of the listed alternatives, a TACL error occurs
unless you specify the OTHERWISE alternative. If you use OTHERWISE, an invalid
argument does not produce a TACL error; your routine must retrieve and examine the
invalid argument and determine an appropriate action.
Using #ARGUMENT
To define a fixed order for arguments, use a sequence of #ARGUMENT statements.
The following statements search for a file name, followed by a slash, followed by a
variable name of type text:
#PUSH fn var
SINK [#ARGUMENT /VALUE fn/ FILENAME/SYNTAX/]
SINK [#ARGUMENT SLASH]
SINK [#ARGUMENT /VALUE var/ VARIABLE /ALLOW TEXT/]
The VALUE options cause the #ARGUMENT built-in functions to store the actual
argument in the specified variable. If there is an error, the program ends with an
error; otherwise, the SINK calls suppress the results of the #ARGUMENT calls. (Each
#ARGUMENT statement processes one type of argument, so the result is always 1
unless an error occurs.)