pTAL Reference Manual (H06.08+)
Simple Variables
HP pTAL Reference Manual—523746-006
7-4
Initializing Simple Variables With Numbers
Initializing Simple Variables With Numbers
When you initialize with a number, it must match the data type specified for the simple
variable. The data type determines what kind of values the simple variable can store:
•
STRING, INT, and INT(32) simple variables can contain integer constants in binary,
decimal, hexadecimal, or octal base.
•
REAL and REAL(64) simple variables can contain signed floating-point numbers.
•
FIXED simple variables can contain signed 64-bit fixed-point numbers in binary,
decimal, hexadecimal, or octal base. For decimal numbers, you can also specify a
fractional part, preceded by a decimal point. If a FIXED number has a different
decimal setting than the specified fpoint, the system scales the number to match
the fpoint. If the number is scaled down, some precision is lost.
Section 3, Data Representation, describes the syntax for specifying numeric constants
in each number base by data type.
Initializing Simple Variables With Character
Strings
STRING, INT, and UNSIGNED simple variables can be initialized with character
strings. The character string can contain the same number of bytes as the simple
variable or fewer. Unspecified bytes are zero bytes. Each character in a character
string requires one byte of storage.
Examples
•
Example 7-1, Declaring Simple Variables Without Initializing Them, on page 7-5
•
Example 7-2, Declaring and Initializing Simple Variables, on page 7-5
•
Example 7-3, Effect of fpoint on FIXED Simple Variables, on page 7-5
•
Example 7-4, Initializing Simple Variables With Constants and Variables*, on
page 7-6
•
Example 7-5, Declaring Simple VOLATILE Variables, on page 7-6
•
Example 7-6, PROCADDR and PROCPTR, on page 7-6










