TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-29
#ARGUMENT Built-In Function
Other special VALUE results are documented in the descriptions of the individual
alternatives. In the majority of cases, however, TEXT and VALUE results are the same.
•
As shown in the preceding table, a given argument can meet the criteria for more
than one alternative. When this occurs, TACL uses the first such alternative tested
and places its interpretation (if any) on the VALUE result. You should, therefore,
order the alternatives in an #ARGUMENT call so that the alternative that
corresponds to the type of argument most likely to be processed by #ARGUMENT
appears first in the alternatives list.
Examples
1. This example shows the use of #ARGUMENT to examine the argument list of a
routine.
#PUSH arg
[#LOOP |DO|
[#CASE [#ARGUMENT /VALUE arg/ FILENAME SUBVOL END]
| 1 | #OUTPUT Argument is existing file named [arg].
| 2 | #OUTPUT Argument is valid subvolume [arg].
| 3 | #OUTPUT No more arguments to parse.
] == End of case
|UNTIL| NOT [#MORE]
] == End of loop
2. This example shows how a STRING argument can be processed. Assume that
RTN is a routine defined as follows:
#FRAME
#PUSH txt vlu
== Get a string, using #IF to discard #ARGUMENT result
#IF [#ARGUMENT /TEXT txt, VALUE vlu/ STRING]
== Get end-of-args, using #IF to discard #ARGUMENT result
#IF [#ARGUMENT END]
== Show string as originally entered
#OUTPUTV "TEXT: " '+' txt
== Show string after evaluation and concatenation
#OUTPUTV "VALUE: " '+' vlu
#UNFRAME
Table 9-4. Some Effects of Expectation on VALUE Result
Alternative Argument Text Value
String fn fn FILENAME
Variable fn fn :MYDIR:FN.1
Filename fn fn \SYS.$VOL.SUBVOL.FN