SPL to HP C/XL Migration Guide (30231-90001)

3- 5
Constant Types
Table 3-8. Constant Types
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| Numeric | Numeric |
| | |
---------------------------------------------------------------------------------------------
| | |
| String | String literal |
| | |
---------------------------------------------------------------------------------------------
| | |
| One-byte string | Character |
| | |
---------------------------------------------------------------------------------------------
SPL has two types of constants: numeric and string. You may have to
specify the type of the constant with a modifier to avoid errors when
mixing types.
HP C/XL has four types of constants: integer, floating point, charac-
ter, and enumeration. Type mixing is generally allowed in HP C/XL, so
you do not need to specify types except when you want to control word
size.
NOTE HP C/XL does not permit a leading unary "+" sign, only a unary "-"
sign.
Integer Constants
Table 3-9. Integer Constants
---------------------------------------------------------------------------------------------
| | |
| SPL | HP C/XL Equivalent |
| | |
---------------------------------------------------------------------------------------------
| | |
| Type: INTEGER | Type: short int |
| | |
---------------------------------------------------------------------------------------------
| | |
|
integer-constant
: |
integer-constant
: |
| | |
| [
sign
]
integer
| [-]
integer
|
| | |
---------------------------------------------------------------------------------------------