From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48b3e9df2fd37d9d X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: unconstrained array clarification Date: 1998/09/22 Message-ID: #1/1 X-Deja-AN: 393753032 References: Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1998-09-22T00:00:00+00:00 List-Id: In article WishList@2600.com (Technobabble) writes: > What I want to do is to keep the addresses for several arrays of records > of different lengths in an array of pointers. Then write the contents of > each record to I/O. The problem is to do this with only the array of > pointers, if I don't want to keep track of the size of each array (number > of records), and I want to use the RANGE attribute to determine the size. > But the only way I have of getting to the array of records is via the > pointer. I didn't design this stuff either, it's adopted from legacy > code. I'll re-code the stuff in GNAT with the changes you've supplied and > see if I can get a good compile. What you want to do is to declare an access type which is your object type: type XYZ is private; type XYZ_Array is array(Natural range <>) of XYZ; ... private type XYZ_Object is array(Natural range <>) of Foo; type XYZ is access XYZ_Object; If Foo is Character, you can use Ada.Strings.Unbounded, otherwise you can use the GNAT implementation to see how to make it all work. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...