next up previous contents index
Next: Named Constants. Up: Tokens Previous: Keywords

Constants

    Numeric constants  are by default specified in decimal units. Octal and hexadecimal constants are specified using a leading 0 and 0x (or 0X), respectively. Thus, the following are equivalent: 15, 017, 0xf. Constants can be specified to be a longint by using a trailing l or L. Otherwise, their type is integer.

Floating point values can contain a decimal point (.) and an exponent (e or E). For example, 0.001 and 1e-3 are equivalent. By default, floating point constants are of type float; a double is specified by using a trailing l or L.

    Character constants are delimited by single quotes. For example, the character a is specified by 'a'. A list of special characters is shown in Table 2.

   table85
Table 2: Special Characters in ZPL.

Other ASCII characters can be specified numerically by using the octal and hexadecimal escape sequences to specify octal and hexadecimal bit sequences. For example, ' tex2html_wrap_inline2299 x07' specifies the ASCII character whose numeric value is 7 in hexadecimal (this happens to be the bell character).

String constants are delimited by double quotes ("). String constants may not span multiple lines, but consecutive string constants are automatically concatenated by the compiler to represent a single long string constant. Thus, the following are equivalent:
"hello world"
"hello " "world".





Kay Nettle
Fri Feb 21 21:14:29 CST 1997