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=-0.1 required=5.0 tests=AXB_XMAILER_MIMEOLE_OL_024C2, BAYES_00,MAILING_LIST_MULTI,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,84e2aa485c11dd80,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-25 08:09:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!enst.fr!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: can a record contain an array whose bounds are not known at compile time? Date: Fri, 25 Oct 2002 10:08:50 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: <2E74048954205C4EBEF1B2C592A559030840A2@satlrccdlmb03.delta.rl.delta.com> Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1035558543 11022 137.194.161.2 (25 Oct 2002 15:09:03 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 25 Oct 2002 15:09:03 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:30135 Date: 2002-10-25T10:08:50-05:00 ----- Original Message ----- From: "Yu, Liyang" To: Sent: Friday, October 25, 2002 9:05 AM Subject: can a record contain an array whose bounds are not known at compile time? > Hi, > > I need to use an array in a record and this array's bound is not known at > compile time. Can Ada do this? Can someone give me a example about how to do > this or any reference that I can use? > Better (in my view) than the use of discriminated records suggested by others is to first declare an access type to the array type, then use a record component of the array access type. E.g, if the array is an array of Integers type Integer_Array is array (Natural range <>) of Integer; type Integer_Array_Access is access all Integer_Array; type MyRecord is record Integers : Integer_Array_Access; end record; > Thanks! > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >