comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com (Tom Moran)
Subject: Re: Record Representation clauses with variant records?
Date: 1998/08/15
Date: 1998-08-15T00:00:00+00:00	[thread overview]
Message-ID: <35d5bf32.588897@SantaClara01.news.InterNex.Net> (raw)
In-Reply-To: 01BDC7CA.487BDC40@usr53-dialup35.mix1.Bloomington.mci.net

>Is there a way of defining a record representation clause for a variant =
>record?
An example used by the CLAW demo:
        type Actual_Color_Type(Kind : Color_Type_Kinds := RGB_Kind) is
record
            case Kind is
                when Index_Kind =>
                    Palette_Index: Palette_Index_Type;
                when RGB_Kind | Palette_RGB_Kind =>
                    Red,
                    Green,
                    Blue   : Color_Intensities;
                when Invalid_Kind =>
                    null;
            end case;
        end record;

        for Actual_Color_Type use record
            Red           at 0 range 0 .. 7;
            Green         at 1 range 0 .. 7;
            Blue          at 2 range 0 .. 7;
            Kind          at 3 range 0 .. 7;
            Palette_Index at 0 range 0 .. 15;
        end record;





           reply	other threads:[~1998-08-15  0:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <01BDC7CA.487BDC40@usr53-dialup35.mix1.Bloomington.mci.net>]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox