comp.lang.ada
 help / color / mirror / Atom feed
From: Leslie <jlturriff@centurytel.net>
Subject: Re: How to convert a string containing two hex digits to a character?
Date: Wed, 06 Jan 2010 16:19:35 -0600
Date: 2010-01-06T16:19:35-06:00	[thread overview]
Message-ID: <hi327t$8fd$1@news.albasani.net> (raw)
In-Reply-To: hi16e5$sj5$1@speranza.aioe.org

tmoran@acm.org wrote:

>   Hex_Pair : String(1 .. 2) := "7C";
> 
>   Char : Character
>     := Character'val(Integer'value("16#" & Hex_Pair & "#"));
> 
> Of course if this is homework in an Intro to Ada class, the
> teacher may not believe you came up with this by yourself.

        No, this is not for school. :-)  After 30 years of COBOL and
REXX, I'm trying to teach myself Ada, which I'm finding a lot
more understandable than C, especially for text manipulation.

        Thanks very much for this elegant solution; text handling seems
to be a somewhat neglected subject in the Ada books and web
sites I've been reading.

Leslie



  reply	other threads:[~2010-01-06 22:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06  0:39 How to convert a string containing two hex digits to a character? Leslie
2010-01-06  0:43 ` Leslie
2010-01-06  1:22   ` Hibou57 (Yannick Duchêne)
2010-01-06  1:31     ` Hibou57 (Yannick Duchêne)
2010-01-06  2:05       ` Leslie
2010-01-06  2:39     ` Leslie
2010-01-06  2:42       ` Leslie
2010-01-06 21:54     ` Maciej Sobczak
2010-01-06 22:19       ` Hibou57 (Yannick Duchêne)
2010-01-09 10:50         ` Hibou57 (Yannick Duchêne)
2010-01-09 11:13           ` Hibou57 (Yannick Duchêne)
2010-01-09 11:33             ` Dmitry A. Kazakov
2010-01-09 14:50               ` Hibou57 (Yannick Duchêne)
2010-01-09 16:04                 ` Dmitry A. Kazakov
2010-01-11 15:53                   ` Adam Beneschan
2010-01-11 18:13                     ` Dmitry A. Kazakov
2010-01-15 19:59                     ` Hibou57 (Yannick Duchêne)
2010-01-15 22:06                       ` John B. Matthews
2010-01-06  5:17 ` tmoran
2010-01-06 22:19   ` Leslie [this message]
2010-01-06 22:22   ` Hibou57 (Yannick Duchêne)
2010-01-07 14:26 ` John B. Matthews
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox