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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,be28f9de3e9d4e8f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-16 20:56:03 PST Path: supernews.google.com!sn-xit-03!supernews.com!cyclone2.usenetserver.com!news-out.usenetserver.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!news.mindspring.net!not-for-mail From: Lao Xiao Hai Newsgroups: comp.lang.ada Subject: Re: Ascii keyword?? Date: Fri, 16 Feb 2001 20:51:02 -0800 Organization: AdaWorks Software Engineering Message-ID: <3A8E0336.FE82B6FC@ix.netcom.com> References: <3A8D72D4.BBB57470@blueyonder.co.uk> <96kcm8$gcq$1@hobbes2.crc.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 3f.35.b3.77 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 17 Feb 2001 04:52:26 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:5321 Date: 2001-02-17T04:52:26+00:00 List-Id: "David C. Hoos, Sr." wrote: > What you need is the language-defined function > Character'Val () to convert > a number in the range 0 .. 255 to its corresponding > character, and the language-defined function > Character'Pos () to obtain its > position in the character set -- 0 .. 255; > > E.g., Character'Val (65) returns 'A', and > Character'Pos ('A') returns 65. > David, I made the assumption he needed to convert ascii strings to numbers. That might have been incorrect. Often, when teaching Ada, I find that this kind of question, when posed by someone from a C/C++ background, is not really about the one-to-one correspondence between the character name and the numeric ASCII value, but rather about making numbers from strings and vice-versa.