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-Thread: a07f3367d7,a7135c0f450945a5,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!news2.glorb.com!feeder.erje.net!news.musoftware.de!wum.musoftware.de!news.albasani.net!not-for-mail From: Leslie Newsgroups: comp.lang.ada Subject: How to convert a string containing two hex digits to a character? Date: Tue, 05 Jan 2010 18:39:39 -0600 Organization: albasani.net Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.albasani.net fZ/etKkZ7H0AxcsYHeFyYlEaQcxFoNOBnX7Rpnt5hMITT7qkkAkYSxAzZG9sYkwxrvya4zE/EXwrZkw2C2F9LX4aGvCS96D7Xr6xdoOCABBFi3ddaOA9ilTYqqz7BLga X-Complaints-To: abuse@albasani.net NNTP-Posting-Date: Wed, 6 Jan 2010 00:38:43 +0000 (UTC) X-User-ID: mcyHO2VA+kOdhD2dDuzXdjOiRClhgR78DOwwHAOKkTT0HZ+ifuRqlw7KpiFFzIqgNe74zXKJUotIuKAkbXjTqQ== Cancel-Lock: sha1:R0ESWvw2kliIAZX1alOySO+JREY= User-Agent: KNode/0.10.9 X-NNTP-Posting-Host: HpY/Gm9y1owINewXuPDWOfr0jZNKsAz2k645O40kx5U= Xref: g2news1.google.com comp.lang.ada:8622 Date: 2010-01-05T18:39:39-06:00 List-Id: Hi, it's me again. :-) I need to be able to convert a string variable containing two hexadecimal digits (e.g. "7C") to its equivalent character value. I see from ARM 3.5.5 "Operations of Discrete Types" that I can use function S'Val(Arg : universal_integer) return S'Base where universal_integer would be the numeric value of the string, but how do I get from "7C" to 16#7C# when 7C is a string value, not a constant? I.e., Hex_Pair : unbounded_string; begin Hex_Pair := slice(some_string,1,2); Char_Code : character; -- now what? end; Leslie