From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9bd91636f2b444a0,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-29 18:35:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!128.230.129.106!news.maxwell.syr.edu!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!drn From: mike@athome Newsgroups: comp.lang.ada Subject: how to print position number of an enumeration variable? Date: 29 Sep 2001 18:09:55 -0700 Organization: Newsguy News Service [http://newsguy.com] Message-ID: <9p5rd30202n@drn.newsguy.com> NNTP-Posting-Host: p-252.newsdawg.com X-Newsreader: Direct Read News 2.90 Xref: archiver1.google.com comp.lang.ada:13528 Date: 2001-09-29T18:09:55-07:00 List-Id: hello, suppose I have a variable of some enumeration type, and I want to print or find the position number in the enumeration type that this variable holds. How can do that? for example: ----------- with Ada.Text_Io; use Ada.Text_Io; procedure Enum is type Day_type is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); Day Day_Type := Monday; begin Put_Line("the position number of first enumeration elemenet is " & Day_type'Image( ???? ) ); end Enum; --------------- I know that the first enumeration literal will have a position of 0. But I just wanted to see if one can print this value. I looked at the attributes of scalar data types, and do not see something like S'pos ? thanks, mike