Compiler Library/XL Reference Manual (32650-90029)

3-: 4
Table 3-1. Rules for Data Type Conversion
---------------------------------------------------------------------------------------------
| | | |
| Data Type | Value of datatype | Result |
| | | |
---------------------------------------------------------------------------------------------
| | | |
| SHORTINT | 0 | Truncates a fractional input. |
| | | |
| REAL | 1 | Accepts a fractional input. |
| | | |
| INTEGER | -1 | Truncates a fractional input. |
| | | |
| LONGREAL | -2 | Accepts a fractional input. |
| | | |
---------------------------------------------------------------------------------------------
4. Leading blanks in the input string are ignored; if the parameter
delimiters is odd, trailing blanks are treated as zeros.
5. If error is set to an odd value, an illegal character was input;
if error is odd and negative, an illegal character and illegal
value was detected. The parameter intlvalue is computed from the
input string characters that preceded the delimiting digit or
illegal character. Parameter stringlen can be used as an index
into charstring to locate that delimiter or illegal character.
The following are examples of illegal character inputs:
+1.345A (A is illegal)
7543CUP (C, U, and P are illegal)
6. If error is set to 2, no integer or fraction value was detected
and a result cannot be computed. The following are examples of
non-value inputs:
+.E5 (the exponent E5 has no base)
-.A (no base, no exponent)
7. When case is significant, the names for the EXTIN'/HPEXTIN
procedure are in lower case.
NOTE Dollar signs ($) and commas for monetary or numeration form in the
input are ignored, but they must be counted in parameter stringlen,
and must be in the proper places (for example, $ must lead a
number, and commas should appear every third digit).
INEXT'/HPINEXT
INEXT' and HPINEXT are two names for the same utility procedure.
INEXT'/HPINEXT converts a number in storage (in one of four internal
representations) to a byte array for an output string of ASCII digits.
The internal representations are:
* SHORTINT
* REAL
* INTEGER
* LONGREAL
See the "Comments" section for more details.