TAL Programmer's Guide
Using Structure Pointers
Using Pointers
096254 Tandem Computers Incorporated 9–25
Specify INT32INDEX or NOINT32INDEX immediately before the declarations to
which it applies. The specified directive then applies to those declarations throughout
the compilation. The following D-series example shows how INT32INDEX generates
correct offsets and NOINT32INDEX generates incorrect offsets:
!The default NOINT32INDEX is in effect.
STRUCT .EXT xstruct[0:9999]; !XSTRUCT has NOINT32INDEX
BEGIN ! attribute
STRING array[0:9];
END;
INT index;
PROC my_proc MAIN;
BEGIN
?INT32INDEX !Assign INT32INDEX
! attribute to subsequent
! declaration
INT .EXT xstruct_ptr (xstruct) := @xstruct[0];
!XSTRUCT_PTR has INT32INDEX
! attribute
!Some code here
xstruct_ptr[index].array[0]:= 1;
!Generate correct offset even
! when offset is > 32,767,
! because XSTRUCT_PTR has
! INT32INDEX attribute
xstruct2[index].array[0] := 1;
!Generate incorrect offset
! if offset is > 32,767,
! because XSTRUCT2 has
END; ! NOINT32INDEX attribute