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,d3b2e17058959a22 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-21 22:58:48 PST Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!uunet!in1.uu.net!intrepid.intrepid.com!usenet From: vladimir@speedy.intrepid.com (Vladimir Vukicevic) Newsgroups: comp.lang.ada Subject: Re: C++ to Ada95, help please Date: 22 Mar 1995 05:07:58 GMT Organization: Intrepid Technology, Inc. Message-ID: References: <3kjd2m$d3t@jerry.rb.icl.co.uk> <19950321.232735.72@banana.demon.co.uk> NNTP-Posting-Host: speedy.intrepid.com In-reply-to: kevq@banana.demon.co.uk's message of Tue, 21 Mar 1995 23:27:35 GMT Date: 1995-03-22T05:07:58+00:00 List-Id: In article <3kjd2m$d3t@jerry.rb.icl.co.uk>, skj@rb.icl.co.uk (Simon Johnston) wrote: I think you want something like: package Foo is type A_Type is (FOO, BAR); for A_Type'Size use 8; -- Should probably be Integer'Size or whatever for A_Type use (FOO => 1, BAR => 2); type Blah (disc : A_Type) is record case disc is when FOO => one : Integer; when BAR => two : Integer; end case; end record; for Blah use record disc at 0 range 0 .. (A_Type'Size-1); one at 1 range 0 .. (Integer'Size-1); two at 1 range 0 .. (Integer'Size-1); end record; end Foo; With the right types and sizes, of course, but this should work. Note that you have to speicifically decide which of the variables you want to be your discriminant; in your example, item1 or item2... if these can only legally hold values of constants, you should consider creating an enumerated type with a representation clause, as above. - Vladimir