Unconstrained arrays in nested record structures

"Prichard, Jayson" <[email protected]>
Newsgroups gmane.comp.gcc.gnat
Message-ID <D3DFE02B3C4DBA4699874BA3F9BE24A70BA0FE@MBSP06.services.sp.trw.com>
I am trying to design a nested record structure with each record having an unconstrained array.  Can anyone tell me if the following is possible in Ada/GNAT?  How should this structure be accessed?



 type RECORD_ARRAY_TYPE_2  is array ( INTEGER range <> )
    of INTEGER ;


 type DTED_DATA_RECORD_TYPE is record 
    DDR_RECOGNITION                     : STRING (1..1) ;
    DDR_DATA_BLOCK_COUNT         : STRING (1..1) ;
    DDR_LONGITUDE_COUNT            : STRING (1..1) ;
    DDR_LATITUDE_COUNT               : STRING (1..1) ;
    DTED_ELEVATION_RECORD        : RECORD_ARRAY_TYPE_2 ( 1 .. NUMBER_OF_ELEVATION_POSTS_PER_CELL ) ;
    DDR_CHECKSUM                         : STRING (1..1) ;
 end record ;

 type RECORD_ARRAY_TYPE_1  is array ( INTEGER range <> )
    of DTED_DATA_RECORD_TYPE ;

 type DTED_FILE_RECORD_TYPE is record
    UHL_RECORD                      : STRING (1..1) ;
    DSI_RECORD                       : STRING (1..1) ;
    ACC_RECORD                      : STRING (1..1) ;
    DTED_DATA_RECORD          : RECORD_ARRAY_TYPE_1 ( 1 .. NUMBER_OF_RECORDS_PER_CELL ) ;
 end record ;




   DTED_FILE_RECORD : DTED_FILE_RECORD_TYPE  ;

   DTED_DATA_FILE : DIRECT_IO.FILE_TYPE ;

 package DIRECT_IO is new ADA.DIRECT_IO ( DTED_FILE_RECORD_TYPE ) ;

   use DIRECT_IO ;

_______________________________________________
Help-gnat mailing list
[email protected]
http://mail.gnu.org/mailman/listinfo/help-gnat
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.