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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9bd91636f2b444a0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-30 05:50:18 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dewar@gnat.com (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: how to print position number of an enumeration variable? Date: 30 Sep 2001 05:50:17 -0700 Organization: http://groups.google.com/ Message-ID: <5ee5b646.0109300450.7675d04b@posting.google.com> References: <9p5rd30202n@drn.newsguy.com> <3uvt7.55862$QK.36794657@news1.sttln1.wa.home.com> <9p6b3m02v4v@drn.newsguy.com> NNTP-Posting-Host: 205.232.38.14 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1001854217 9045 127.0.0.1 (30 Sep 2001 12:50:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 30 Sep 2001 12:50:17 GMT Xref: archiver1.google.com comp.lang.ada:13543 Date: 2001-09-30T12:50:17+00:00 List-Id: mike@nospam wrote in message news:<9p6b3m02v4v@drn.newsguy.com>... > In article <3uvt7.55862$QK.36794657@news1.sttln1.wa.home.com>, "DuckE" says... > > > >Perhaps: > > Put_Line( "the position number of the first enumeration element is " & > > Integer'Image( Day_Type'Pos( Day_Type'First ) ) ); > > > >SteveD > > > > but 'pos is not listed as an attribute. I am looking at page 34-36 of the RM, > and I do not see such attribute for scalar types (that is why I asked), and enum > is scalar type. > > strange. But thanks! > > mike Yes, but 'Pos is not defined for all scalar types, so of course you do not see it there, instead look for attributes of discrete types and you will find it in RM 3.5.5. But a little higher level advice, you definitely need to improve your skills in finding things in the RM. Two suggestions: 1. If you have a paper copy (or an electronic copy), use the index. That is what it is there for! The index is quite complete, and there is an entry for Pos that points to 3.5.5. 2. Get an electronic copy. There are HTML versions around, but I prefer a straight ASCII version easily searched in any editor, and then just search for Pos.