pTAL Reference Manual (H06.08+)

Built-In Routines
HP pTAL Reference Manual523746-006
15-23
$ALPHA
expression
is an expression (as described in Section 5, Expressions).
If the absolute value of a negative INT, INT(32), or FIXED expression cannot be
represented in twos complement form (for example, if expression has the INT
value -32,768), $ABS traps if overflow traps are enabled (see Section 13, Hardware
Indicators); otherwise, $ABS ignores the problem.
$ALPHA
$ALPHA tests the right byte of an INT value for the presence of an alphabetic
character.
int-expression
is an INT expression.
$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 at the beginning of this section.
Example 15-9. $ABS Routine
INT int_val := -5;
INT abs_val;
abs_val := $ABS(int_val); ! Return 5, the absolute value of -5
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW No
( )
VST073.vsd
$ALPHA
int-expression