pTAL Reference Manual (H06.08+)

Equivalenced Variables
HP pTAL Reference Manual523746-006
11-6
Declaring Nonstructure Equivalenced Variables
previous-identifier
the identifier of a previously-declared variable, direct array element, pointer,
structure, structure pointer, or equivalenced variable.
index
is an INT constant that specifies an element offset from previous-identifier
to which the equivalenced pointer or variable refers. Specify index only with
direct variables. index must end on a word boundary.
+
-
is the word or byte offset, relative to the base of previous-identifier, where
the equivalenced variable is placed. For example, if a and b are declared:
INT a[0:9];
INT b = a+5
then b is placed at a[5].
offset
is an INT constant that specifies a word offset from previous-identifier,
which can be a direct or indirect variable. If previous-identifier is indirect,
the offset is from the location of the pointer, not from the location of the data
pointed to.
The following are valid equivalenced declarations:
INT a;
INT b = a;
INT(32) c[0:3];
INT d[0:7] = c;
Topics:
Memory Usage for Nonstructured Equivalenced Variables on page 11-7
Equivalenced Arrays on page 11-7
Indirect Arrays on page 11-8
Equivalenced Simple Variables on page 11-8
Equivalenced Simple Pointers on page 11-10