pTAL Reference Manual (H06.08+)
HP pTAL Reference Manual—523746-006
11-1
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 11-1 on page 11-1 to any
variable in the second column.
Table 11-1. Equivalenced Variables
You can use an equivalenced variable in an expression anywhere an operand is valid.
Equivalenced (New) Variable Previous Variable
Simple variable
Simple pointer
Structure
Structure pointer
Simple variable
Simple pointer
Structure
Structure pointer
Array
Equivalenced variable
Table 11-2. Equivalenced Variable Terminology (page 1 of 2)
Term Definition
Equivalenced variable The identifier that appears on the left side of an equivalenced
declaration; for example:
INT previous;
INT equivalenced = previous;
Previous 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;
Direct equivalent
declaration
The equivalenced variable is a simple variable
, direct array, direct
structure, standard pointer (including a standard structure
pointer), or extended pointer (including an extended structure
pointer). Direct items can be equivalenced only to other direct
items (with two exceptions).
Indirect equivalent
declaration
The equivalenced variable is a standard indirect array or standard
indirect structure. Standard indirect items can be equivalenced
only to other standard indirect items.










