Previous Topic Next topic Print topic


Simple and Subscripted References

A simple reference is a name without any subscripts, pointer qualifiers, structure names, or argument lists.

A subscripted reference is a name that has been declared as an array, followed by a parenthetical list of subscript expressions. Each subscript expression must produce an integer fixed-point value that lies within the lower and upper bounds specified for that dimension in the array declaration. The number of subscript expressions must be equal to the number of dimensions.

An asterisk subscript refers to the entire array bounds range for the corresponding dimension. Subscripts containing asterisks do not refer to a single data item. Thus, such references are array expressions, not element expressions.

A cross-section of an array may reference two or more elements that are not stored adjacently in memory. Such storage is referred to as non-connected storage.

DECLARE A(5,5) FLOAT; 
DECLARE B(10) FLOAT;
   .
   .
   .
A(K*2,*) = B(1); 
A(*,*) = 5;

In the preceding example, both A (K*2,*) and B (1) are subscripted references; K is a simple reference. A(*,*) references the entire array and A(K*2,*) references the entire 2Kth row.

Previous Topic Next topic Print topic