STRUCTURE BLOCK VARIABLE Declaration

<structure block variable declaration>

                                    ┌◄───── , ─────┐
──<structure block type identifier>─┴─<identifier>─┴───────────────────┤

A STRUCTURE BLOCK VARIABLE declaration declares a single instance of a structure block with the type of the structure block type identifier.

Structure block types and instances 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 STR2ID;             %ALLOWED
     * * *
     END;  %STRBLOCKTYPE1
STRBLOCKTYPE1 STRID1;                  %ALLOWED
STRID1.STRBLOCKTYPE2 STR2ID            %NOT ALLOWED
STRBLOCKTYPE1.STRBLOCKTYPE2 STR2ID2;   %NOT ALLOWED
* * *
END.

Identifiers

<structure block variable identifier>

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