TAL Reference Manual
Standard Functions
TAL Reference Manual—526371-001
14-7
Usage Considerations
Usage Considerations
If the absolute value of a negative INT, INT(32), or FIXED expression cannot be
represented in two’s complement form, $ABS sets the overflow indicator. For example,
if X has the INT value –32,768, $ABS(X) causes an arithmetic overflow.
Example of $ABS Function
In this example, $ABS returns an absolute value from an INT expression:
INT int_val := -5; !Declare variables
INT abs_val;
abs_val := $ABS(int_val); !Return 5, the absolute value
! of -5
$ALPHA Function
The $ALPHA function tests the right byte of an INT value for the presence of an
alphabetic character.
int-expression
is an INT expression.
Usage Considerations
$ALPHA inspects bits <8:15> of int-expression and ignores bits <0:7>. It tests for an
alphabetic character according to the following criteria:
int-expression >= "A" AND int-expression <= "Z" OR
int-expression >= "a" AND int-expression <= "z"
If an alphabetic character occurs, $ALPHA sets the condition code indicator to CCE
(condition code equal to). If you plan to check the condition code, do so before an
arithmetic operation or assignment occurs.
If the character passes the test, $ALPHA 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.
$ALPHA (
int-expression )
VST1402.vsd