comp.lang.ada
 help / color / mirror / Atom feed
* Hex to Dez conversion?
@ 1996-06-09  0:00 Haug Buerger
  1996-06-09  0:00 ` Robert Dewar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Haug Buerger @ 1996-06-09  0:00 UTC (permalink / raw)




Hi,

    has anybody code to convert a string with a hex number to an
integer? I think Ada 95 has lots of possibilities with charsets
and conversion functions. Has anybody code that uses it?

Thanks
        Haug





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Hex to Dez conversion?
  1996-06-09  0:00 Hex to Dez conversion? Haug Buerger
@ 1996-06-09  0:00 ` Robert Dewar
  1996-06-10  0:00 ` Mark A Biggar
  1996-06-10  0:00 ` Walter B. Hollman Sr.
  2 siblings, 0 replies; 4+ messages in thread
From: Robert Dewar @ 1996-06-09  0:00 UTC (permalink / raw)



Haug asks

"Hi,

    has anybody code to convert a string with a hex number to an
integer? I think Ada 95 has lots of possibilities with charsets
and conversion functions. Has anybody code that uses it?
"

Most obvious answer use get from a string to read the number in hex
(adding 16# at the start and # at the end), and that will do it!





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Hex to Dez conversion?
  1996-06-09  0:00 Hex to Dez conversion? Haug Buerger
  1996-06-09  0:00 ` Robert Dewar
  1996-06-10  0:00 ` Mark A Biggar
@ 1996-06-10  0:00 ` Walter B. Hollman Sr.
  2 siblings, 0 replies; 4+ messages in thread
From: Walter B. Hollman Sr. @ 1996-06-10  0:00 UTC (permalink / raw)



On Jun 09, 1996 21:08:18 in article <Hex to Dez conversion?>,
'haug@zesi.ruhr.de (Haug Buerger)' wrote: 
 
 
> 
>Hi, 
> 
>has anybody code to convert a string with a hex number to an 
>integer? I think Ada 95 has lots of possibilities with charsets 
>and conversion functions. Has anybody code that uses it? 
> 
>Thanks 
>Haug 
> 
-- 
Why not just write a small test program, the compiler is FREE! 
Walter B. Hollman Sr 
 
 
 
 
 
 
 





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Hex to Dez conversion?
  1996-06-09  0:00 Hex to Dez conversion? Haug Buerger
  1996-06-09  0:00 ` Robert Dewar
@ 1996-06-10  0:00 ` Mark A Biggar
  1996-06-10  0:00 ` Walter B. Hollman Sr.
  2 siblings, 0 replies; 4+ messages in thread
From: Mark A Biggar @ 1996-06-10  0:00 UTC (permalink / raw)



In article <31bb2122.5a455349@zesi.ruhr.de> haug@zesi.ruhr.de (Haug Buerger) writes:
>    has anybody code to convert a string with a hex number to an
>integer? I think Ada 95 has lots of possibilities with charsets
>and conversion functions. Has anybody code that uses it?

Assuming the string contains just the hex number (i.e., has no spaces in 
it, etc.) the following should work:

Int := Integer'VALUE("16#" & Str & "#");

--
Mark Biggar
mab@wdl.loral.com






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-06-10  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-09  0:00 Hex to Dez conversion? Haug Buerger
1996-06-09  0:00 ` Robert Dewar
1996-06-10  0:00 ` Mark A Biggar
1996-06-10  0:00 ` Walter B. Hollman Sr.

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