comp.lang.ada
 help / color / mirror / Atom feed
From: Samuel Tardieu <sam@ada.eu.org>
To: rlove@neosoft.com (Robert B. Love )
Subject: Re: Rep Clause Vaues??
Date: 1997/01/22
Date: 1997-01-22T00:00:00+00:00	[thread overview]
Message-ID: <qw6wwt6kjrj.fsf@esmeralda.enst.fr> (raw)
In-Reply-To: 5c3oh5$7oh@uuneo.neosoft.com


>>>>> "Robert" == Robert B Love <rlove@neosoft.com> writes:

Robert> What method can I use to get back the bit pattern or integer
Robert> value represented by the enumerated type?  All my attempts at
Robert> type conversion and pos/val attributes have failed.

Wanna be dirty? :) The untested piece of code below should do the job
using the Get_Value function:

###
   type Int_Mechs is mod 2 ** Mechs'Size;
   for Int_Mechs'Size use Mechs'Size;

   function Get_Value is new Ada.Unchecked_Conversion (Mechs, Int_Mechs);
###

  Sam
-- 
Samuel Tardieu -- sam@ada.eu.org




  reply	other threads:[~1997-01-22  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-22  0:00 Rep Clause Vaues?? Robert B. Love 
1997-01-22  0:00 ` Samuel Tardieu [this message]
1997-01-22  0:00 ` David C. Hoos, Sr.
1997-01-24  0:00   ` Robert A Duff
1997-01-25  0:00 ` Robert Dewar
1997-01-26  0:00   ` Matthew Heaney
1997-01-26  0:00     ` Robert Dewar
replies disabled

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