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 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-29 23:27:56 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!news-out.worldnet.att.net.MISMATCH!wn3feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3BB6BB75.D88EECE3@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: how to print position number of an enumeration variable? References: <9p5rd30202n@drn.newsguy.com> <3uvt7.55862$QK.36794657@news1.sttln1.wa.home.com> <9p6b3m02v4v@drn.newsguy.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sun, 30 Sep 2001 06:27:55 GMT NNTP-Posting-Host: 12.86.32.134 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1001831275 12.86.32.134 (Sun, 30 Sep 2001 06:27:55 GMT) NNTP-Posting-Date: Sun, 30 Sep 2001 06:27:55 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:13539 Date: 2001-09-30T06:27:55+00:00 List-Id: "mike@nospam" wrote: > > 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! Look again. This time look at page 474 of the RM, in the summary of Language Defined Attributes. You will find the following: S'Pos For every discrete subtype S: S'Pos denotes a function with the following specification: function S'Pos(Arg : S'Base) return universal_integer This function returns the position number of the value Arg, as a value of type universal_integer. All enumeration types are discrete types. Jim Rogers Colorado Springs, Colorado USA