pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
8 Arrays
An array is a one-dimensional set of elements of the same data type. Each array is stored as a
collective group of elements. You use arrays to store constants, especially character strings. After
you declare an array, you can use its identifier to access the array elements individually or as a
group.
You can declare:
• Arrays
• Read-only arrays
• Address arrays
The declaration includes initializing the array as well as allocating storage for the array. In addition
the declaration determines:
• The kind of values the array can represent
• The operations you can perform on the array
• The byte or word addressing mode of the array
This section defines the syntax for declaring:
• Arrays
• Read-only arrays
• Address arrays
Chapter 9 (page 114) describes the syntax for declaring arrays within structures and how to declare
structures that simulate arrays of arrays, or arrays of structures (including multidimensional arrays).
Topics:
• Declaring Arrays (page 108)
• Declaring Read-Only Arrays (page 111)
• Using Constant Lists in Array Declarations (page 113)
Declaring Arrays
An array declaration associates an identifier with a set of elements of the same data type. The
data type of an array can be one of the pTAL address types.
type
is one of the following:
• BADDR
• CBADDR
108 Arrays