pTAL Reference Manual (H06.03+)
HP pTAL Reference Manual—523746-005
6-1
6 LITERALs and DEFINEs
A LITERAL declaration associates identifiers with constant values. A DEFINE
declaration associates identifiers (and parameters if any) with text.
You can declare LITERALs and DEFINEs once in a program, and then refer to them by
identifier many times throughout the program. They allow you to efficiently make
significant changes in the source code. You only need to change the declaration, not
every reference to it in the program.
Topics:
•
Declaring Literals on page 6-1
•
Declaring DEFINEs on page 6-3
•
Calling DEFINEs on page 6-5
•
How the Compiler Processes DEFINEs on page 6-6
•
Passing Actual Parameters to DEFINEs on page 6-7
Declaring Literals
A LITERAL declaration specifies one or more identifiers and associates each with a
constant value. Each identifier in a LITERAL declaration is known as a LITERAL.
identifier
is the LITERAL identifier. 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.
,
constant
LITERAL identifier
=
VST018.vsd










