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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,b85c1b84f840dc22 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: I need a little help - it's been a long time - with enumeration type and for use representation Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <7495d29e-0361-4eba-9e22-a770ae50f113@d5g2000yqm.googlegroups.com> Date: Fri, 13 Nov 2009 20:13:27 +0100 Message-ID: NNTP-Posting-Date: 13 Nov 2009 20:13:27 CET NNTP-Posting-Host: ed7cf102.newsspool3.arcor-online.net X-Trace: DXC=XUo]]Zg^X?`]l@YUW5NBknMcF=Q^Z^V3h4Fo<]lROoRa8kF On Fri, 13 Nov 2009 11:48:12 -0700, Jeffrey R. Carter wrote: > Dmitry A. Kazakov wrote: >> >> You parse "0x", then you do a hexadecimal number following it, then you >> pass that number (x) to: >> >> Spell_School_Type'Val (x) > > This doesn't work with a non-default representation. 'Val reverses 'Pos, and > 'Pos gives sequential values starting with zero, regardless of the representation. But it works with the modular type proposed. An enumeration type was not meant. For enumeration types one should parse names, rather than arbitrary bit patterns. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de