Next: Storage Sequence
Up: Arrays
Previous: Declaring Arrays
An array element reference must always use the same number of
subscripts as the number of dimensions declared for the array.
Each subscript can be an integer expression of any complexity, but
there are restrictions on functions with side effects (see section
9.3).
An array element reference is only valid if all of the subscript
expressions are defined and if each one is in the range declared for
it. An array element can only be used in an expression if a value
for it has been defined. A DATA statement (section 12) can be
used to define an initial value for an entire array or any set of
elements.
An array can be used without subscripts:
- in a specification statement such as a type,
DIMENSION, or SAVE statement;
- in a function reference or CALL statement: this transfers
the whole of the array to the associated dummy
argument (which must have a compatible array
declaration);
- in the data transfer list of a READ or WRITE statement:
this causes the whole array to be input or output. This
is not permitted for an assumed size dummy argument
array.
- as a unit identifier in a READ or WRITE statement: a
character array is then an internal file with one record
per element.
- as a format identifier in a READ or WRITE statement:
the format specification is contained in the character
array with its elements taken in sequence.
Next: Storage Sequence
Up: Arrays
Previous: Declaring Arrays
Helen Rowlands
8/27/1998