TAL Reference Manual
Simple Variables
TAL Reference Manual—526371-001
6-2
Usage Considerations
•
For a global simple variable, use a constant expression.
•
For a local or sublocal simple variable, use any arithmetic expression including
variables.
You can initialize simple variables of any data type except UNSIGNED.
Usage Considerations
Simple variables are always directly addressed.
Initializing 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.
For more information on syntax specifying numeric constants in each number base by
data type, see Section 3, Data Representation
.
Initializing With Character Strings
When you initialize a simple variable with a character string, the character string can
contain the same number of bytes as the simple variable or fewer. Each character in a
character string requires one byte of contiguous storage. The values of any
uninitialized bytes are undefined.
Examples of Simple Variable Declarations
1. The following examples declare simple variables of different data types without
initializing them:
STRING b;
INT(32) dblwd1;
REAL(64) long;
UNSIGNED(5) flavor;