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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,54d6c9fe8e306128 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada.Containers.Indefinite_Doubly_Linked_Lists References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1170700387 12.201.97.213 (Mon, 05 Feb 2007 18:33:07 GMT) NNTP-Posting-Date: Mon, 05 Feb 2007 18:33:07 GMT Organization: AT&T ASP.att.net Date: Mon, 05 Feb 2007 18:33:07 GMT Xref: g2news2.google.com comp.lang.ada:8973 Date: 2007-02-05T18:33:07+00:00 List-Id: Carroll, Andrew wrote: > > Type Attribute is record > Name: String(50); > Type: String(25); Type, of course, is a reserved word. String is an unconstrained array type, and needs to be constrained by a range: Name : String (1 .. 50); Note that Name will always be 50 characters. If you want Names of varying lengths, Unbounded_String is probably the easiest way to go. > I'm kind of lost though as to where these package declarations should > go. Should they be like: > > Package Table_List_Thingy is > > Type Attribute is record > Name: String(50); > Type: String(25); > ... > End record; > > Package Attribute_List is new new > Ada.Containers.Indefinite_Doubly_Linked_Lists (Attribute); > > OR > > Procedure RunMe(...) is > > Type Attribute is record > Name: String(50); > Type: String(25); > ... > End record; > > Package Attribute_List is new new > Ada.Containers.Indefinite_Doubly_Linked_Lists (Attribute); Yes. Either will work. Which you should use depends on the problem and your design. (Here we encounter one of Ada's most valuable features: you have to think about design before you start coding.) It doesn't look as if you need the indefinite version for either of your lists. -- Jeff Carter "Spam! Spam! Spam! Spam! Spam! Spam! Spam! Spam!" Monty Python's Flying Circus 53