comp.lang.ada
 help / color / mirror / Atom feed
* Rep Clause Vaues??
@ 1997-01-22  0:00 Robert B. Love 
  1997-01-22  0:00 ` David C. Hoos, Sr.
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Robert B. Love  @ 1997-01-22  0:00 UTC (permalink / raw)




Because of design aspects beyond my control I find myself wanting
to know how to return the bit pattern of an enumerated type that
has a specific rep spec.  A simple example fragment is in order--

type mechs is (bolt,latch);
for mechs use(bolt => 12, latch => 29);

mechanism : mechs := latch;
bit_pattern : integer;

begin
   ....
   ....
   bit_pattern := Integer(mechs'val(mechanism));
   ....
end

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

All help appreciated.
----------------------------------------------------------------
Bob Love, rlove@neosoft.com (local)        MIME & NeXT Mail OK
rlove@raptor.rmnug.org  (permanent)        PGP key available
----------------------------------------------------------------





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1997-01-26  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-22  0:00 Rep Clause Vaues?? Robert B. Love 
1997-01-22  0:00 ` David C. Hoos, Sr.
1997-01-24  0:00   ` Robert A Duff
1997-01-22  0:00 ` Samuel Tardieu
1997-01-25  0:00 ` Robert Dewar
1997-01-26  0:00   ` Matthew Heaney
1997-01-26  0:00     ` Robert Dewar

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