pTAL Reference Manual (H06.03+)

Built-In Routines
HP pTAL Reference Manual523746-005
15-73
$OPTIONAL
$OPTIONAL
$OPTIONAL controls whether a given parameter or parameter pair is passed to a
VARIABLE procedure or EXTENSIBLE procedure.
cond-expression
is a conditional expression
. If cond-expression is true, param or param-pair
is passed. If cond-expression is false, param (or param-pair ) is not
passed.
param
is an a variable identifier or an expression
that defines an actual parameter to pass
to a formal parameter declared in the called procedure if cond-expression is
true.
Example 15-67. $OFFSET Routine Applied to a Template Structure
INT x;
STRUCT st[-1:1];
BEGIN
INT item;
FIXED(2) price;
END;
x := $OFFSET (st[-1].item); !x gets -10
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW No
$OPTIONAL
( cond-expression , param
param-pair
)
VST213.vsd