comp.lang.ada
 help / color / mirror / Atom feed
From: "Gautier direct_replies_not_read" <gautier_niouzes@hotmail.com>
Subject: Re: pre-defined function convert hex to decimal?
Date: Wed, 20 Nov 2002 19:49:47 +0000
Date: 2002-11-20T19:49:47+00:00	[thread overview]
Message-ID: <mailman.1037821802.12769.comp.lang.ada@ada.eu.org> (raw)

>is there a pre-defined function in ada that converts hex to decimal,
>or do I have to write from scratch? thanks

You can use the 'Image and 'Value attributes. E.g.:

with Ada.Text_IO;
procedure Test_hex_to_dec is
begin
  Ada.Text_IO.Put( Integer'Image( Integer'Value("16#1A2B3C#") ) );
end;
________________________________________________________
Gautier  --  http://www.mysunrise.ch/users/gdm/gsoft.htm

NB: For a direct answer, address on the Web site!


_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus




             reply	other threads:[~2002-11-20 19:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-20 19:49 Gautier direct_replies_not_read [this message]
     [not found] <mailman.1037815682.9555.comp.lang.ada@ada.eu.org>
2002-11-20 18:44 ` pre-defined function convert hex to decimal? Robert A Duff
2002-11-21 13:39   ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2002-11-20 17:12 Sarah Thomas
replies disabled

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