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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a5d:9b81:: with SMTP id r1mr1089975iom.38.1548237960376; Wed, 23 Jan 2019 02:06:00 -0800 (PST) X-Received: by 2002:a9d:da3:: with SMTP id 32mr34019ots.3.1548237960111; Wed, 23 Jan 2019 02:06:00 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!q69no825750itb.0!news-out.google.com!v71ni957ita.0!nntp.google.com!q69no825748itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 23 Jan 2019 02:05:59 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.126.240.2; posting-account=Rb9AYAoAAACJxfG9wutXlaLWNAfJy4_j NNTP-Posting-Host: 94.126.240.2 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <3d782720-227d-4d86-b403-eacbd1b9d0d2@googlegroups.com> Subject: Problem with Position of the enumeration Type From: Luis Ladron de Guevara Moreno Injection-Date: Wed, 23 Jan 2019 10:06:00 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55331 Date: 2019-01-23T02:05:59-08:00 List-Id: Hello, I have an issue with the declaration of the enumeration type, when i try to map the values of an enumeration to a specific position. the code: procedure EnumerationTest is Position : Integer; type E_Test is (Pos10, Pos11, Pos12, Pos13, Pos14); for E_Test use (Pos10 => 10, Pos11 => 11, Pos12 => 12, Pos13 => 13, Pos14 => 14); begin for I in E_Test'Base loop Position := E_Test'pos (I); ada.Text_IO.Put (" Position: " & Position'Img & " Value: " & I'Img); end loop; end EnumerationTest; 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. I don't know what it is the exactly meaning of: for E_Test use (Pos10 => 10, Pos11 => 11, Pos12 => 12, Pos13 => 13, Pos14 => 14); and how can i assign a different position for the specific value. Could anyone help me with this problem? Thank you so much =)