pTAL Reference Manual (H06.03+)

Built-In Routines
HP pTAL Reference Manual523746-005
15-3
Expressions as Parameters
Expressions as Parameters
Many built-in routines accept expressions as parameters (see their individual syntax
descriptions). If a parameter of a built-in routine is an expression:
The value of the expression can be any data type except STRING or UNSIGNED.
Except in INT and INT(32) expressions, all operands must be of the same data
type.
An INT expression can include STRING, INT, and UNSIGNED(1-16) operands.
The system treats STRING and UNSIGNED(1-16) operands as if they were 16-bit
values; that is, the system:
°
Places a STRING operand in the right byte of a word and sets the left byte to
0.
°
Places an UNSIGNED(1-16) operand in the right bits of a word and sets the
unused left bits to 0.
An INT(32) expression can include INT(32) and UNSIGNED(17-31) operands.
The system treats UNSIGNED(17-31) operands as if they were 32-bit values.
Before evaluating the expression, the system places an UNSIGNED(17-31)
operand in the right bits of a doubleword and sets the unused left bits to 0.
The built-in routine, not the expression or its data type, determines whether the
value of the parameter is signed or unsigned:
°
Built-in routines that expect signed arguments treat unsigned expressions as if
they were signed.
°
Built-in routines that expect unsigned arguments treat signed expressions as if
they were unsigned.
Example 15-2. Built-In Routine With Address Output Parameter
STRING .s[0:99];
$BUILT_IN_2(@s); ! ERROR: s has no address container
! in which to store a new address