pTAL Conversion Guide

Equivalenced Variables
pTAL Conversion Guide527302-002
12-10
Equivalencing Extended Pointers to Extended Items
Equivalencing Extended Pointers to Extended Items
You can equivalence an extended pointer to an extended array or extended structure,
but you cannot equivalence an extended array or extended structure to an extended
pointer. An extended pointer equivalenced to an extended item is a read-only pointer:
You cannot equivalence a simple EXTADDR variable to an extended array or extended
structure because the EXTADDR variable is a direct variable:
Table 12-1. Valid Equivalenced Variable Declarations
Equivalenced
Variable Category
Equivalenced
Variable Variable Example
Previous Variable
Category
Direct Simple variable INT i; Direct or Pointer
Direct array INT i[0:3];
Direct structure STRUCT s;
BEGIN
INT i;
END;
Indirect Indirect array INT .a[0:3]; Indirect
Indirect structure STRUCT .s;
BEGIN
INT i;
END;
Extended Extended array INT .EXT a[0:3]; Extended
Extended structure STRUCT .EXT s;
BEGIN
INT i;
END;
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 12-6. Equivalencing Extended Pointers to Extended Items (page 1 of 2)
INT .EXT a[0:3]; ! Extended array
INT .EXT b; ! Extended pointer
INT .EXT c = a; ! OK: equivalence pointer to
! extended array
INT .EXT d[0:3] = b; ! ERROR: cannot equivalence an extended
! item to a pointer