TAL Reference Manual

LITERALs and DEFINEs
TAL Reference Manual526371-001
5-2
Usage Considerations
Usage Considerations
The compiler allocates no storage for LITERAL constants. It substitutes the constant at
each occurrence of the identifier.
You access a LITERAL constant by using its identifier in declarations and statements.
LITERAL identifiers make the source code more readable. For example, identifiers
such as BUFFER_LENGTH and TABLE_SIZE are more meaningful than their
respective constant values of 80 and 128.
Examples of LITERAL Declarations
1. This example specifies a constant for each identifier:
LITERAL true = -1,
false = 0,
buffer_length = 80,
table_size = 128,
table_base = %1000,
entry_size = 4,
timeout = %100000D,
CR = %15,
LF = %12;
2. This example specifies no numeric constants; the compiler supplies all the
constants:
LITERAL a, -- The compiler assigns 0
b, -- The compiler assigns 1
c; -- The compiler assigns 2