Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.


9.3.1 Tables of data

Data can be grouped together in many different ways, but probably the most common and straight-forward way is to make a table. In a table the data is ordered either vertically or horizontally, but the important thing is the relative positioning of the elements. The E view of this kind of ordered data is the ARRAY type. An array is just a fixed sized collection of data in order. The size of an array is important and this is fixed when it is declared. The following illustrates array declarations:

DEF a[132]:ARRAY,
    table[21]:ARRAY OF LONG,
    ints[3]:ARRAY OF INT,
    objs[54]:ARRAY OF myobject

The size of the array is given in the square brackets (`[' and `]'). The type of the elements in the array defaults to CHAR, but this can be given explicitly using the OF keyword and the type name. However, only LONG, INT, CHAR and object types are allowed (LONG can hold pointer values so this isn't much of a limitation). Object types are described below (see 9.4 OBJECT Type).

As mentioned above, procedure parameters cannot be arrays (see 9.2.6 Procedure parameters). We will overcome this apparent limitation soon (see 9.3.5 Array procedure parameters).


Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.