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,eb9238bef304c5d4 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "(see below)" Newsgroups: comp.lang.ada Subject: Re: Using discriminant record: problem with assigning to an array in body of case Date: Tue, 17 Mar 2009 20:05:34 +0000 Message-ID: References: <976bd0a5-4aff-4f40-83c7-c6b7829ab4d8@s9g2000prg.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net IFN2o4eKg+J8C7EGyrcU0wd4BFRQRwn2bGl/vdbhNX20CVWfTr Cancel-Lock: sha1:L13deyTSWydKa3sYkDPpR9NG44s= User-Agent: Microsoft-Entourage/12.14.0.081024 Thread-Topic: Using discriminant record: problem with assigning to an array in body of case Thread-Index: AcmnO7sOv3V6e7E1V0qbgje46FF7qw== Xref: g2news1.google.com comp.lang.ada:4160 Date: 2009-03-17T20:05:34+00:00 List-Id: On 17/03/2009 19:55, in article 976bd0a5-4aff-4f40-83c7-c6b7829ab4d8@s9g2000prg.googlegroups.com, "ChristopherL" wrote: > The below procedure compiles and links fine, No, it doesn't. What else have you changed? > but when I run it I get a > "discriminant check failed" error message. Can you please modify this > code so that the array assignment works. > > procedure test is > > type GOODS_TYPE is ( LIQUID, TEXTILE); > > type TYPE_GOODS( GOODS_TYPE_SELECTION : GOODS_TYPE) is > record > > case GOODS_TYPE_SELECTION is > when LIQUID => > ITEM_NAME : is array ( 0..5 ) of float; > > when TEXTILE => > LENGTH : float; > WIDTH : float; > end case; > end record; > > A : TYPE_GOODS( LIQUID ); > > begin > > A := ( GOODS_TYPE_SELECTION => LIQUID, > ITEM_NAME => (1.0, 1.1, 1.2, 1.3, 1.4,1.5) ); > > end test; -- Bill Findlay chez blueyonder.co.uk