Examples of LIST Declarations

The following example declares L1 as a list identifier for the list consisting of X, Y, the array row A[4,*], and B[2], B[3], B[4], and B[5].

LIST L1 (X,Y,A[4,*],FOR I := 2 STEP 1 UNTIL 5 DO B[I])

This list identifier might appear in a WRITE statement such as the following:

WRITE (LP_OUT,//,L1);

The following example declares ANSWERS and RESULTS as two list identifiers with associated list elements.

LIST ANSWERS (P + Q,Z,SQRT(R)),
     RESULTS (X1,X2,X3,X4/2)

The following example declares LIST3 as a list identifier with an associated list consisting of nested FOR clauses indexing array A. This list identifier can be used in a READ statement to read the specified elements of array A.

LIST LIST3 (FOR I := 0 STEP 1 UNTIL 10 DO
               FOR J := 0,3,6 DO
                  A[I,J])