TAL Reference Manual

Standard Functions
TAL Reference Manual526371-001
14-36
Example of $OVERFLOW Function
Example of $OVERFLOW Function
This example turns overflow trapping off, tests the overflow indicator, and turns
overflow trapping back on. CODE statements, however, are not portable to future
software platforms; modularize their use where possible:
INT i, j, k;
CODE (RDE;
ANRI $COMP (%200); !Turn off overflow trap bit
SETE);
i := j + k;
IF $OVERFLOW THEN i := 0; !Test overflow indicator
CODE (RDE;
ANRI $COMP (%040); !Turn on overflow trap bit
ORRI %200; !Disable pending overflow
SETE);
$PARAM Function
The $PARAM function checks for the presence or absence of an actual parameter in
the call that invoked the current procedure or subprocedure.
formal-param
is the identifier of a formal parameter as specified in the procedure or subprocedure
declaration.
Usage Considerations
If the actual parameter corresponding to formal-param is present in the CALL
statement, $PARAM returns 1. If the actual parameter is absent from the CALL
statement, $PARAM returns 0.
Only a VARIABLE procedure or subprocedure or an EXTENSIBLE procedure can use
$PARAM. If such a procedure or subprocedure has required parameters, it must check
for the presence or absence of each required parameter in CALL statements. The
procedure or subprocedure can also use $PARAM to check for optional parameters.
$PARAM ( formal-param
)
VST1437.vsd