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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2dae9e735b6ea318 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-26 16:56:56 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3BD9F79F.B87BE6EC@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: record question References: <3BD9618C.D154FE0C@icn.siemens.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 26 Oct 2001 23:54:14 GMT NNTP-Posting-Host: 63.180.2.44 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1004140454 63.180.2.44 (Fri, 26 Oct 2001 16:54:14 PDT) NNTP-Posting-Date: Fri, 26 Oct 2001 16:54:14 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Fri, 26 Oct 2001 16:50:23 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:15289 Date: 2001-10-26T23:54:14+00:00 List-Id: Alfred Hilscher wrote: > > procedure RT is > type x (i : Integer := 0) is > record > case i is > when 0 => null; > when 1..10 => s : STRING (1..10); > when others => null; > end case; > end record; > > y : x; > begin > y := (1, "ABC "); -- this is OK > > y := (99); -- but, how do that ? > > y.i := 99; -- do not work either, so how assign a value different to > 1..10 ? > end RT; (99) is a parenthesized expression, not an aggregate. An aggregate of one value must use named notation: (I => 99) You may only change a discriminant of an unconstrained record variable by assigning the entire record at once. Since I is a discriminant of type X, "Y.I := ..." is illegal. Thus, you must write: Y := (I => 99); -- Jeff Carter "I wave my private parts at your aunties." Monty Python & the Holy Grail