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

You can equivalence standard pointers to indirect arrays and indirect structures, but you can only
read the value of the pointer. You cannot store an address into the pointer. You can, however,
read or write the data to which the pointer points.
You can equivalence extended pointers to extended arrays and extended structures, but you can
only read the value of the pointer. You cannot store an address into the pointer. You can, however,
read or write the data to which the pointer points.
You can equivalence a standard pointer to an indirect array or indirect structure but you cannot
equivalence an indirect array or indirect structure to a standard pointer. A pointer equivalenced
to an indirect item is a read-only pointer—you can read the address in the pointer, but you cannot
store an address into the pointer.
Example 125 Read-Only Pointer
INT .a[0:3]; ! Indirect array
INT .b; ! Standard pointer
INT .c = a; ! OK: Equivalence a pointer to an indirect
! array (c is read-only)
INT .d[0:3] = b; ! ERROR: Cannot equivalence an indirect item
! to a pointer
@c := @c + 1; ! ERROR: Cannot modify a pointer that is
! equivalenced to an indirect item
When you declare indirect and extended pointers in equivalenced declarations:
The address type of a STRING standard pointer is BADDR. The address type of all other
standard pointers is WADDR.
The address type of extended pointers is always EXTADDR, regardless of the data type of the
objects to which the pointer will refer.
Figure 10 (page 185) shows two examples of the data types associated with pointers. Figure 10
(page 185) shows the object data type and address type. Use Table 54 (page 185) to determine
valid equivalenced declarations.
Figure 10 The Object and Address Types of a Pointer
Table 54 Data Types for Equivalenced Variables
Address TypeObject Data TypeExample
WADDRINTINT a;
WADDRINTINT .b;
EXTADDRINTINT .EXT c;
EXT32ADDR
1
INTINT .EXT32 e;
1
EXT64ADDR
1
INTINT .EXT64 f;
1
WADDRBADDRBADDR a;
Declaring Nonstructure Equivalenced Variables 185