Previous Topic Next topic Print topic


Structure Declarations

The declaration of a structure defines the organization of the structure and the names of members at each level of the structure. The general form of this declaration is:

DECLARE 1 structure_name a⊂1 a⊂2 … a⊂n, 
       k member_name-1 a⊂1 a⊂2 … a⊂n, 
       k member_name-2 a⊂1 a⊂2 …. a⊂n,
           .
           .
           . 
       k member_name–m a⊂1 a⊂2 … a⊂n;

where each member_name specifies a member of the structure preceded by a level-number, k, and where the level-number of each member must be greater than the level-number of its containing structure, equal to level-numbers of members at the same level, and less than the level-numbers of members it contains. The major structure name is declared as structure level 1.

The only attributes given to the structure itself are storage class, ALIGNED, UNALIGNED, DIMENSION, REFER, and UNION. Each member is declared to have all attributes following its name up to the next comma or up to the end of the statement. For example:

DECLARE 1 S    STATIC,
            2  A(5) FLOAT DECIMAL(7),
            2  B  FIXED BINARY(15),
            2  C,
                  3 D   POINTER,
                  3 E   CHARACTER(10) INITIAL('ABC');

In this example, S is a static structure with members A, B, and C. C is a substructure with members D and E. Initial attributes can be given to elementary members of static structures, but not to structures themselves.

Previous Topic Next topic Print topic