pTAL Reference Manual (H06.08+)
Built-In Routines
HP pTAL Reference Manual—523746-006
15-25
$ASCIITOFIXED
qvaluein input
FIXED(*):value
is a value that $ASCIITOFIXED adds to the result of converting the bytes at
bufferaddr. $ASCIITOFIXED multiplies qvaluein by 10 for each digit it
converts from ASCII to FIXED. After it converts the last digit at bufferaddr,
$ASCIITOFIXED adds qvaluein to the result of the conversion to establish the
value that it returns qvalueout.
qvalueout output
FIXED(*):variable
is a quadrupleword integer value that holds the final result of the conversion.
$ASCIITOFIXED converts a string of ASCII-coded digits at bufferaddr to a binary-
coded FIXED value, adds qvaluein times 10
n
, where n is the number of digits
converted, and stores the result in qvalueout.
If a nondigit ASCII code is encountered, $ASCIITOFIXED ends the conversion.
$ASCIITOFIXED converts only the digits before the nondigit ASCII code. CCG
indicates that $ASCIITOFIXED converted only part of the ASCII number. CCE
indicates $ASCIITOFIXED converted the entire string. If overflow traps are enabled
and the result is greater than 2
63
-1 or less than 2
63
, $ASCIITOFIXED sets
$OVERFLOW and qvalueout is undefined.
Example 15-11. $ASCIITOFIXED Routine
LITERAL buffer_len = 100;
STRING .buffer[ 0:buffer_len - 1 ]; ! Buffer to convert
STRING .ptr := @buffer; ! pointer to buffer
INT maxdigits;
INT remainingdigits;
FIXED qvaluein;
FIXED qvalueout;
$ASCIITOFIXED (@ptr, maxdigits, remainingdigits, qvaluein,
qvalueout);










