PS TEXT FORMAT Reference Manual
Expressions
11387 Tandem Computers Incorporated 5-19
ARG Function The ARG function processes macro or user-function arguments; you may
use it only in macros or functions.
ARG (
i-exp
[ ,
b-exp
] )
ARG (
n
) or ARG (
n,#b-exp
), where
b-exp
evaluates to “false,” returns
the value of the
n
th argument in the list of arguments passed to the macro
by the invocation command.
ARG (
n,#b-exp
), where
b-exp
evaluates to “true,” returns the actual
string that was passed as the
n
th argument. For example, assume the
macro PEEKPAGE contains the following:
The page number is \(ARG(1)\).
This number is stored in \(ARG(1,1)\).
The invocation command \PEEKPAGE SYS_PAGENUMBER tells the
macro to print the actual page number (in this example 3):
The page number is 3.
This number is stored in SYS_PAGENUMBER.
If
n
is greater than the number of arguments in the list, TFORM issues a
“value out of range” error. If
n
is zero, the ARG function returns the actual
number of arguments that were passed in the current invocation. (N,S)