TAL Programmer's Guide
Declaring Arrays
Using Arrays
7–4 096254 Tandem Computers Incorporated
Global, Local, and Sublocal Initializations
You can initialize an array declared at any level except for extended indirect arrays
declared at the local level:
INT(32) .a[0:1] := [5D, 7D]; !Global array can be
! initialized
PROC my_procedure;
BEGIN
STRING .b[0:1] := ["A","B"]; !Local array can be
! initialized
FIXED .EXT c[0:3]; !Local extended indirect
! array cannot be initialized
SUBPROC my_subproc;
BEGIN
INT d[0:2] := ["Hello!"]; !Sublocal array can be
!Lots of code ! initialized
END;
END;
Arrays by Data Type The following subsections give information about arrays by data type. For
information about the appropriate range and format of values for each data type, see
Section 6, “Using Simple Variables.”
STRING Arrays
For STRING arrays, the compiler allocates one byte for each element. The compiler
always starts the zeroth element of a STRING array on a word boundary. In the
diagram, question marks denote undefined values:
STRING a[0:2];
STRING b[3:4];
STRING c[-1:1];
361
A[0] A[1]
A[2] ?
? B[3]
B[4] ?
? C[-1]
C[0] C[1]
B[0]