Type declarationsArray typesAn array type is a sequence of components of some other type. The components of an array are distinguished by an index, which also has a specific type. You can define arrays of arrays to represent two or greater than two-dimensional structures. To define arrays, use: ARRAY indextype {,indextype} OF elementtype Each indextype must be BOOLEAN, CHAR, an enumeration type, or a subrange type. A component of the array is defined for each combination of index values. The elementtype can be any type, including array types. An array type with multiple indextypes is simply shorthand for an array type with an array type as the element type. Examples: ARRAY [1..10] OF REAL; SubscriptingYou refer to a component of an array by subscripting an array variable. Subscripting is specified as follows: variable[expression{,expression}] The expressions must be assignable to the index types with which the array variable was declared. The values of the expressions must lie within the range specified by the index type. If an index expression is outside the range of the index type, and the module was compiled with index checking turned on, the program generates a runtime error. Source:
|