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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6433f675cae9b5bc,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-27 08:39:39 PST Path: supernews.google.com!sn-xit-02!sn-uk-post-01!supernews.com!corp.supernews.co.uk!not-for-mail From: "Joe" Newsgroups: comp.lang.ada Subject: Allocate an array of a record with a discriminant? Date: Tue, 27 Mar 2001 16:41:31 +0100 Organization: Posted via Supernews, http://www.supernews.com Message-ID: X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Complaints-To: newsabuse@supernews.com Xref: supernews.google.com comp.lang.ada:6122 Date: 2001-03-27T16:41:31+01:00 List-Id: Dear all, I'd appreciate it greatly if any of you could answer the following question. Basically, I want to create an array of English words. The following information will be given before the words are typed in, _but_ not before runtime: - the maximum length of any one word (the Max_Length variable will contain it) - the number of words to be given (Num_Words) A word would be described by something like the following type: type Word (Max_Length : Integer) is record Length : Integer; S : String (1 .. Max_Length); end record; As I understand it, using discriminants with arrays is not possible such as: type Words (Max_Word_Length : Integer) is array (Natural range <>) of Word (Max_Word_Length); How is it possible to allocate space for an array of type "Word" where all are of the same "Word.Length" which is "Max_Length" at runtime? Keep in mind that Max_Length and Num_Words are given at runtime, not before. Thanks in advance, Joe