comp.lang.ada
 help / color / mirror / Atom feed
From: "James S. Rogers" <jimmaureenrogers@worldnet.att.net>
Subject: Re: Ada Enumerations
Date: 1997/12/03
Date: 1997-12-03T00:00:00+00:00	[thread overview]
Message-ID: <663j9f$e1l@mtinsc02.worldnet.att.net> (raw)
In-Reply-To: 662cs9$b34$1@newman.pcisys.net


Jeffrey Harris <harris@newman.pcisys.net> wrote in article
<662cs9$b34$1@newman.pcisys.net>...
> 
> NewLocation: Integer := DataTypes.LASTTYPE + 1;  -- Newlocation = 101
> 
> The compiler isn't letting me do this.  I've tried to use 'value, 'pos,
and
> 'val to no avail, how do I convert an Ada enumerated type into an integer
value?

The 'Pos attribute returns the position of the enumeration value.  This is
unaffected by the representation clause.  To obtain the representation
value
you must instantiate Ada.Unchecked_Conversion. for your enumeration 
type.

Jim Rogers
Colorado Springs,  Colorado




  reply	other threads:[~1997-12-03  0:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-03  0:00 Ada Enumerations Jeffrey Harris
1997-12-03  0:00 ` James S. Rogers [this message]
1997-12-03  0:00   ` Robert Dewar
1997-12-03  0:00     ` Stanley R. Allen
1997-12-04  0:00       ` GNAT'Object_Size Mats Weber
1997-12-04  0:00       ` Ada Enumerations Robert Dewar
1997-12-04  0:00         ` Stanley R. Allen
1997-12-18  0:00           ` Wes Groleau
1997-12-04  0:00       ` Matthew Heaney
1997-12-04  0:00         ` Stanley R. Allen
1997-12-07  0:00           ` Keith Thompson
1997-12-07  0:00             ` Matthew Heaney
1997-12-07  0:00             ` Robert Dewar
1997-12-08  0:00               ` Keith Thompson
1997-12-07  0:00                 ` Matthew Heaney
1997-12-11  0:00                   ` John G. Volan
1997-12-04  0:00       ` GNAT'Object_Size Mats Weber
1997-12-05  0:00         ` GNAT'Object_Size Mats Weber
1997-12-04  0:00       ` GNAT'Object_Size Mats Weber
1997-12-08  0:00         ` GNAT'Object_Size Mats Weber
1997-12-10  0:00           ` GNAT'Object_Size Robert Dewar
1997-12-04  0:00       ` GNAT'Object_Size Mats Weber
1997-12-04  0:00       ` GNAT'Object_Size Mats Weber
1997-12-04  0:00 ` Ada Enumerations Stephen Leake
1997-12-04  0:00   ` Matthew Heaney
1997-12-04  0:00     ` Robert Dewar
1997-12-06  0:00       ` Jean-Pierre Rosen
1997-12-06  0:00         ` Making Predefined Operators Abstract Matthew Heaney
  -- strict thread matches above, loose matches on Subject: below --
1997-12-10  0:00 Ada enumerations Stanley R. Allen
1997-12-10  0:00 ` John M. Mills
1997-12-10  0:00 ` Robert Dewar
1997-12-11  0:00   ` Stanley R. Allen
1997-12-12  0:00     ` Robert Dewar
1997-12-11  0:00   ` Mats Weber
1997-12-11  0:00     ` Robert Dewar
1997-12-12  0:00       ` Mats Weber
1997-12-12  0:00         ` Robert Dewar
1997-12-12  0:00     ` Samuel T. Harris
replies disabled

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