STRUCTURE BLOCK ARRAY Declaration

<structure block array declaration>

──<structure block type identifier>── ARRAY ───────────────────────────►
  ┌◄───────────────────── , ─────────────────────┐
  │ ┌◄───── , ─────┐                             │
►─┴─┴─<identifier>─┴─ [ ──<bound pair list>── ] ─┴─────────────────────┤

A STRUCTURE BLOCK ARRAY declaration declares an array whose elements are structure block instances. Each lower bound and upper bound in the bound pair list must resolve to a constant arithmetic expression.

Structure block types can be declared within structure blocks, but a structure block variable or array cannot be declared with the type of an inner structure block outside the outer structure block.

The following example illustrates the declaration of structure blocks:

BEGIN
TYPE STRUCTURE BLOCK STRBLOCKTYPE1;
     BEGIN
     REAL R;
     TYPE STRUCTURE BLOCK STRBLOCKTYPE2;
          BEGIN
          REAL RR;
          * * *
          END;   %STRBLOCKTYPE2
     STRBLOCKTYPE2 ARRAY STR2ID [0:10];             %ALLOWED
     * * *
     END;  %STRBLOCKTYPE1
STRBLOCKTYPE1 ARRAY STRID1 [0:10];                  %ALLOWED
STRID1.STRBLOCKTYPE2 ARRAY STR2ID [0:10];           %NOT ALLOWED
STRBLOCKTYPE1.STRBLOCKTYPE2 ARRAY STR2ID2 [0:10];   %NOT ALLOWED
* * *
END.

Identifiers

<structure block array identifier>

An identifier associated with a structure block array in a STRUCTURE BLOCK ARRAY declaration.

<structure block array designator>

──<structure block array identifier>─┬─────────────────────┬───────────┤
                                     └─<subarray selector>─┘

<structure block array row>

──<structure block array identifier>─┬────────────────┬────────────────┤
                                     └─<row selector>─┘

<structure block array element>

                                          ┌◄───── , ────┐
──<structure block array identifier>── [ ─┴─<subscript>─┴─ ] ──────────┤