TAL Programmer's Guide
Accessing Structure Items
Using Structures
096254 Tandem Computers Incorporated 8–33
Standard Addressing Contrasted With Extended Indexing
The allowed offset of a standard indirect structure item is greater than that of an
extended indirect structure item. The following example declares a standard indirect
structure item accessed by an index that is greater than that allowed for an extended
indirect structure item:
LITERAL ub = 32759;
STRUCT .t[0:ub]; !Standard indirect structure
BEGIN
STRING x, y;
END;
PROC m MAIN;
BEGIN
INT index;
FOR index := 0 TO ub DO
t[index].x := t[index].y := 0;
END;
If you change the preceding standard indirect structure to an extended indirect
structure, you must also change the index that is applied to the structure item to an
INT(32) index:
LITERAL ub = 32759;
STRUCT .EXT t[0:ub]; !Extended indirect structure
BEGIN
STRING x, y;
END;
PROC m MAIN;
BEGIN
INT index;
FOR index := 0 TO ub DO
BEGIN
t[index].x := t[index].y := 0;
!Compiler generates incorrect code
t[$DBL(index)].x := t[$DBL(index)].y := 0;
!Compiler generates correct code
END;
END;