comp.lang.ada
 help / color / mirror / Atom feed
* Enumeration representation
@ 2004-01-01 20:44 Luke A. Guest
  2004-01-01 21:45 ` Stephen Leake
  2004-01-02  2:46 ` Robert A Duff
  0 siblings, 2 replies; 37+ messages in thread
From: Luke A. Guest @ 2004-01-01 20:44 UTC (permalink / raw)


Hi,

Am I correct in saying that enumerations don't necessarily begin at zero?
Is this implementation dependent?

Thanks,
Luke.




^ permalink raw reply	[flat|nested] 37+ messages in thread
* Enumeration representation
@ 1999-09-10  0:00 Alex
  1999-09-10  0:00 ` Ted Dennison
                   ` (4 more replies)
  0 siblings, 5 replies; 37+ messages in thread
From: Alex @ 1999-09-10  0:00 UTC (permalink / raw)


I've written the following example program for testing enumeration
represetantion clause:

with Ada.Text_IO; use Ada.Text_IO;


procedure MainEnum is

      type Status is (a,b,c,d,e);
      pragma Discard_Names(Status);

      for Status use
       ( a => 0,
         b => 20,
         c => 400,
         d => 800,
         e => 1600);

       S : Status;
begin
      S := b;
      Put(" => " & S'img);
end MainEnum;

I've compiled it with Gnat (the latest version)
the output of program is 1 but I was expecting another value : 20.
Does  Gnat support this clause?
Did I use this clause badly?

Thank you very much,
by
Alessandro Busato
busato@newtech.it





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

end of thread, other threads:[~2004-01-03 13:42 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-01 20:44 Enumeration representation Luke A. Guest
2004-01-01 21:45 ` Stephen Leake
2004-01-01 22:01   ` Luke A. Guest
2004-01-02  1:17     ` tmoran
2004-01-02  1:29     ` Stephen Leake
2004-01-02  3:10       ` Luke A. Guest
2004-01-02  2:46 ` Robert A Duff
2004-01-02  3:12   ` Luke A. Guest
2004-01-02 13:58   ` Marin David Condic
2004-01-02 21:39     ` Pat Rogers
2004-01-03 13:42       ` Marin David Condic
2004-01-03  1:53     ` Robert A Duff
2004-01-02 20:52   ` Randy Brukardt
2004-01-02 21:05     ` Luke A. Guest
  -- strict thread matches above, loose matches on Subject: below --
1999-09-10  0:00 Alex
1999-09-10  0:00 ` Ted Dennison
1999-09-10  0:00   ` Robert Dewar
1999-09-13  0:00     ` Ted Dennison
1999-09-10  0:00 ` David C. Hoos, Sr.
1999-09-10  0:00   ` Robert Dewar
1999-09-10  0:00 ` Keith Thompson
1999-09-11  0:00   ` Robert Dewar
1999-09-11  0:00     ` Keith Thompson
1999-09-12  0:00       ` Bryce Bardin
1999-09-13  0:00         ` Robert Dewar
1999-09-13  0:00           ` Keith Thompson
1999-09-13  0:00       ` Robert Dewar
1999-09-12  0:00         ` Keith Thompson
1999-09-13  0:00           ` Robert Dewar
1999-09-13  0:00             ` Keith Thompson
1999-09-14  0:00               ` Robert Dewar
1999-09-13  0:00             ` Ted Dennison
1999-09-13  0:00         ` Robert A Duff
1999-09-13  0:00           ` Robert Dewar
1999-09-10  0:00 ` Matthew Heaney
1999-09-10  0:00   ` Robert Dewar
1999-09-13  0:00 ` Alex

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