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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Problem with Position of the enumeration Type Date: Wed, 23 Jan 2019 17:06:05 +0000 Organization: A noiseless patient Spider Message-ID: References: <3d782720-227d-4d86-b403-eacbd1b9d0d2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="5df60c48b299959a20b2371e8012729a"; logging-data="23996"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+E3y4rrj3PjBbUwqTXogdYGuczi5/SObc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (darwin) Cancel-Lock: sha1:d24KLI9x8wsW8Lim5PQzJ/61WrA= sha1:WtwAToeSB/sWMIfX/f1qEu44qtc= Xref: reader01.eternal-september.org comp.lang.ada:55340 Date: 2019-01-23T17:06:05+00:00 List-Id: Luis Ladron de Guevara Moreno writes: > type E_Test is (Pos10, Pos11, Pos12, Pos13, Pos14); > > for E_Test use (Pos10 => 10, > Pos11 => 11, > Pos12 => 12, > Pos13 => 13, > Pos14 => 14); > i thought that the result of the position was 10, 11, 12, 13, 14. But > When i run this code, the result is 0, 1, 2, 3. As Karl Müller hinted, you can use the non-standard GNAT implementation-defined attribute 'Enum_Rep[1]. The next page describes 'Enum_Val. [1] https://gcc.gnu.org/onlinedocs/gnat_rm/Attribute-Enum_005fRep.html