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 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!news.mixmin.net!news.tornevall.net!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: I need a little help - it's been a long time - with enumeration type and for use representation Date: Fri, 13 Nov 2009 13:32:52 -0700 Organization: TornevallNET - http://news.tornevall.net Message-ID: References: <7495d29e-0361-4eba-9e22-a770ae50f113@d5g2000yqm.googlegroups.com> NNTP-Posting-Host: cc15c599bff5e04804ba67954c6dfce6 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: d8d5d635cdcaa2f114a48df621f00d15 X-Complaints-To: abuse@tornevall.net X-Complaints-Language: Spoken language is english or swedish - NOT ITALIAN, FRENCH, GERMAN OR ANY OTHER LANGUAGE! In-Reply-To: X-Validate-Post: http://news.tornevall.net/validate.php?trace=d8d5d635cdcaa2f114a48df621f00d15 X-SpeedUI: 1738 X-Complaints-Italiano: Parlo la lingua non � italiano User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) X-Posting-User: 9b22bfe2855937f9b3faeec7cfc91295 Xref: g2news1.google.com comp.lang.ada:8094 Date: 2009-11-13T13:32:52-07:00 List-Id: Dmitry A. Kazakov wrote: > 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. I see. I cannot imagine using 'Val in this case. Since you start with a String containing the hexadecimal image of a value, I'd simply do Numeric_Type_Name'Value ("16#" & Source (Start .. Stop) & '#'); -- Jeff Carter "Son of a window-dresser." Monty Python & the Holy Grail 12