pTAL Reference Manual (H06.08+)
Equivalenced Variables
HP pTAL Reference Manual—523746-006
11-3
Declaring Equivalenced Variables
You can index a variable that participates in an equivalenced declaration either as the
equivalenced variable or as the previous variable even if none of the variables in the
equivalenced group specify array bounds.
Standard Pointer Standard pointer INT .p; A pointer, simple
variable, indirect
array, or indirect
structure
Standard structure
pointer
INT .s(t);
Extended Pointer Extended pointer INT .EXT e; Direct or Extended
with the same
address type
(EXTADDR)
Extended structure
pointer
INT .EXT s(t);
Example 11-1. Declaring Equivalenced Variables
INT a; ! a is a simple variable, and cannot be indexed
INT b; ! "Previous variable" for the next decl
INT c = b; ! b and c can be indexed
INT d = c; ! c and d can be indexed
! Variables b, c, and d can be indexed because each appears in
! an equivalenced declaration:
c[2] := b[1]; ! OK: b and c appear in equivalenced declaration
d[2] := c[1]; ! OK: c and d appear in equivalenced declaration
d[2] := a; ! OK: d appears in equivalenced declaration
! and can be indexed.
a[1] := d; ! ERROR: a cannot be indexed
Table 11-3. Valid Equivalenced Variable Declarations (page 2 of 2)
Equivalenced
Variable Category
Equivalenced
Variable Variable Example
Previous Variable
Category










