TAL Reference Manual
Standard Functions
TAL Reference Manual—526371-001
14-40
$SPECIAL Function
$SPECIAL Function
The $SPECIAL function tests the right half of an INT value for the presence of an
ASCII special (non-alphanumeric) character.
int-expression
is an INT expression.
Usage Considerations
$SPECIAL inspects bits <8:15> of the int-expression and ignores bits <0:7>. It tests for
a special character according to the following criterion:
int-expression.<8:15> <> alphabetic AND int-expression.<8:15> <> numeric
If $SPECIAL finds a special character, it sets the condition code to CCG (condition
code greater than). If you plan to check the condition code, do so before an arithmetic
operation or a variable assignment occurs.
If the character passes the test, $SPECIAL returns a –1 (true); otherwise, $SPECIAL
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 $SPECIAL Function
In this example, $SPECIAL tests for the presence of a special 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 $SPECIAL (char) THEN ... ; !Test for special character
$SWITCHES Function
The $SWITCHES function is described in Section 15, Privileged Procedures.
$SPECIAL
( )
int-expression
VST1442.vsd