pTAL Reference Manual (H06.08+)
Built-In Routines
HP pTAL Reference Manual—523746-006
15-39
$EXCHANGE
If a FIXED expression has a nonzero fpoint, the compiler multiplies or divides the
result by the appropriate power of ten.
$EXCHANGE
$EXCHANGE exchanges the values of two variables of the same data type.
var1 input,output
anytype: var
a variable whose contents are exchanged with var2.
var2 input,output
anytype: var
a variable whose contents are exchanged with var1.
var1 and var2 must meet the following requirements:
•
var1 and var2 must both be INT variables or both be INT(32) variables.
•
Neither var1 nor var2 can be a structure, but they can be fields of structures.
•
Neither var1 nor var2 can be STRING, UNSIGNED, or USE variables, nor can
they be bit strings.
•
var1, var2, or both can be array elements.
•
If var1 or var2 names an entire array, $EXCHANGE exchanges element 0 of
the array.
Example 15-27. $EFLTR Routine
REAL(64) rndnum;
FIXED(3) fixnum := 12345.678F;
rndnum := $EFLTR (fixnum); ! Return rounded REAL(64) value
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW No
) ;
VST615.vsd
$EXCHANGE (
var1
,
var2










