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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!m26g2000yqb.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: How to convert a string containing two hex digits to a character? Date: Wed, 6 Jan 2010 14:22:25 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 77.198.58.121 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1262816545 7323 127.0.0.1 (6 Jan 2010 22:22:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 6 Jan 2010 22:22:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m26g2000yqb.googlegroups.com; posting-host=77.198.58.121; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8641 Date: 2010-01-06T14:22:25-08:00 List-Id: On 6 jan, 06:17, tmo...@acm.org wrote: > =A0 Hex_Pair : String(1 .. 2) :=3D "7C"; > > =A0 Char : Character > =A0 =A0 :=3D Character'val(Integer'value("16#" & Hex_Pair & "#")); > > Of course if this is homework in an Intro to Ada class, the teacher may n= ot > believe you came up with this by yourself. We do not know about the context, and depending on the context, as en example, if he/she was supposed to learn more about attributes, then your way would be the better one (not easy to give a good answer to a student when we do not know about the context and the real expectations)