pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

11 Equivalenced Variables
Equivalencing lets you declare more than one identifier and description for a location in a storage
area. Equivalenced variables that represent the same location can have different data types and
byte-addressing and word-addressing attributes. For example, you can refer to an INT(32) variable
as two separate words or four separate bytes.
You can equivalence any variable in the first column of Table 51 (page 177) to any variable in the
second column.
Table 51 Equivalenced Variables
Previous VariableEquivalenced (New) Variable
Simple variableSimple variable
Simple pointerSimple pointer
StructureStructure
Structure pointerStructure pointer
Array
Equivalenced variable
You can use an equivalenced variable in an expression anywhere an operand is valid.
Table 52 Equivalenced Variable Terminology
DefinitionTerm
The identifier that appears on the left side of an equivalenced
declaration; for example:
INT previous;
INT equivalenced = previous;
Equivalenced variable
The identifier that appears on the right side of the equivalenced
declaration. The previous variable can, itself, be an equivalenced
variable; for example:
INT base_previous;
INT equivalenced1 = base_previous;
INT equivalenced2 = equivalenced1;
Previous variable
The equivalenced variable is a simple variable, direct array, direct
structure, standard pointer (including a standard structure pointer), or
Direct equivalent declaration
extended pointer (including an extended structure pointer). Direct items
can be equivalenced only to other direct items (with two exceptions).
The equivalenced variable is a standard indirect array or standard
indirect structure. Standard indirect items can be equivalenced only to
other standard indirect items.
Indirect equivalent declaration
The equivalenced variable is an extended indirect array or extended
indirect structure. Extended indirect items can be equivalenced only to
other extended indirect items.
Extended equivalent declaration
The equivalenced variable is a pointer to data.Standard pointer equivalent declaration
The equivalenced variable is a pointer to data in an EXTADDR.Extended pointer equivalent declaration
Topics:
Declaring Equivalenced Variables (page 178)
Memory Allocation (page 179)
Declaring Nonstructure Equivalenced Variables (page 180)
Equivalencing Procedure Addresses (PROCADDR, PROC32ADDR, and PROC64ADDR) and
Pointer Variables (PROCPTR, PROC32PTR, and PROC64PTR) (page 187)
177