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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,60973b026c6e423d X-Google-Attributes: gid103376,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: help: character to integer Date: 1996/10/02 Message-ID: <52t8la$2l8@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 186652955 references: <52s2pl$18l@dailyplanet.wam.umd.edu> organization: Comp Sci, RMIT, Melbourne, Australia nntp-posting-user: ok newsgroups: comp.lang.ada Date: 1996-10-02T00:00:00+00:00 List-Id: spear@wam.umd.edu (Eric Anthony Spear) writes: >I've tried to find the answer in the RM, but I haven't had any luck. It's there. >Is there a function, either in a package or as an attribute, that can work >like this BASIC function: >i = ASC("X") >That is, the function returns the ASCII value of the given character. Values of any discrete type can be converted to integers using the 'Pos attribute and back again using the 'Val attribute. This was so in Ada 83 and is still so in Ada 95. You want I := Character'Pos('X'); -- Australian citizen since 14 August 1996. *Now* I can vote the xxxs out! Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.