pTAL Reference Manual (H06.08+)

Built-In Routines
HP pTAL Reference Manual523746-006
15-47
$FIXI
qresidue output
FIXED(*):variable
holds any of the original value that was not converted because maxdigits
bytes were converted without converting all of qvalue.
$FIXEDTOASCIIRESIDUE returns in qresidue any portion of qvalue that it does
not convert because maxdigits digits were written but qvalue was not fully
converted.
If $FIXEDTOASCIIRESIDUE converts maxdigits bytes but leading digits in qvalue
are not converted, and $OVERFLOW can be checked, $FIXEDTOASCIIRESIDUEI
sets $OVERFLOW; otherwise, it resets $OVERFLOW.
$FIXI
$FIXI converts a FIXED value to a signed INT value.
fixed-expression
is a FIXED expression, which $FIXI treats as a FIXED expression, ignoring any
implied decimal point.
If the result cannot be represented in a signed 16-bit integer, $FIXI traps if overflow
traps are enabled (see Section 13, Hardware Indicators
); otherwise, $FIXI ignores the
problem.
Example 15-35. $FIXEDTOASCIIRESIDUE Routine
LITERAL buffer_len = 100;
FIXED val;
STRING .buffer[ 0:buffer_len - 1 ];
FIXED residue;
$FIXEDTOASCIIRESIDUE(val, @buffer, buffer_len, residue);
pTAL privileged procedure No
Can be executed only by privileged procedures No
Sets condition code No
Sets $CARRY No
Sets $OVERFLOW Yes
( )
VST086.vsd
$FIXI
fixed-expression