Admin Production rocket
Current Publication

構造体の宣言

Enterprise Developer for Eclipse (including UNIX Components) (Japanese) V7.0
Rocket® Enterprise Developer (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

構造体の宣言

構造体の宣言では、構造体の構成と構造体の各レベルのメンバーの名前を定義します。この宣言の一般的な形式は次のとおりです。

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;

member_name には、構造体の各メンバーを前にレベル番号 k を付けて指定します。それぞれのメンバーについて、そのメンバーを含む構造体よりも大きく、同じレベルのメンバーと同一で、そのメンバーに含まれるメンバーよりも小さいレベル番号を指定する必要があります。主構造体の名前を構造体レベル 1 として宣言します。

構造体自体に指定される属性は、ストレージ クラス、ALIGNED、UNALIGNED、DIMENSION、REFER、および UNION のみです。各メンバーは、それぞれの名前に続けて次のカンマまたは文の最後までに記述されたすべての属性を持つものとして宣言されます。次に例を示します。

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');

この例では、S は A、B、および C をメンバーとする静的な構造体です。C はサブ構造体であり、メンバー D および E を含みます。静的構造体の基本メンバーに対しては初期属性を指定できますが、構造体自体には指定できません。