pTAL Reference Manual (H06.03+)

Built-In Routines
HP pTAL Reference Manual523746-005
15-86
$STACK_ALLOCATE
int-expression
is an INT expression.
$SPECIAL inspects bits <8:15> of the int-expression and ignores bits <0:7>.
$SPECIAL (int-expression ) has the same value as:
NOT $NUMERIC(int-expression ) AND NOT $ALPHABETIC(int-expression )
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 (see
Expressions as Parameters on page 15-3).
In Example 15-85 on page 15-86, $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.
$STACK_ALLOCATE
$STACK_ALLOCATE allocates a block of memory on the stack and returns the
address of the block.
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW No
Example 15-85. $SPECIAL Routine
STRING char;
IF $SPECIAL (char) THEN ... ; ! Test for special character
Note. The pTAL and EpTAL compilers behave differently.
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW No
( size )
VST032.vsd
$STACK_ALLOCATE