TAL Reference Manual
Standard Functions
TAL Reference Manual—526371-001
14-28
Example of $MIN Function
Example of $MIN Function
In this example, $MIN returns the minimum of a FIXED expression and a constant:
FIXED fixval := -3F;
min := $MIN (fixval, 5F); !Return -3F
$NUMERIC Function
The $NUMERIC function tests the right half of an INT value for the presence of an
ASCII numeric character.
int-expression
is an INT expression.
Usage Considerations
$NUMERIC inspects bits <8:15> of int-expression and ignores bits <0:7>. It tests for a
numeric character according to the criterion:
int-expression >= "0" AND int-expression <= "9"
If a numeric character occurs, $NUMERIC sets the condition code to CCL (condition
code less than). If you plan to test the condition code, do so before an arithmetic
operation or assignment occurs.
If the character passes the test, $NUMERIC returns a –1 (true); otherwise, it returns a
0 (false).
int-expression can include STRING and UNSIGNED(1–16) operands, as described in
Expression Arguments
on page 14-5.
Example of $NUMERIC Function
In this example, $NUMERIC tests for a numeric character in a STRING argument,
which the system places in the right byte of a word and treats as an INT value:
STRING char; !Declare variable
IF $NUMERIC (char) THEN ... ; !Test for numeric character
$NUMERIC ( int-expression
)
VST1431.vsd