comp.lang.ada
 help / color / mirror / Atom feed
* Converting Strings to Floats and/or Integers
@ 1998-08-26  0:00 mrpinga
  1998-08-26  0:00 ` Samuel Tardieu
  0 siblings, 1 reply; 2+ messages in thread
From: mrpinga @ 1998-08-26  0:00 UTC (permalink / raw)


Help me please!

I am supposed to be writing a commandline calculator for one of my courses
but i am having a little trouble... I desperately need to know how to convert
a string to a float or integer.

ie. if mystring := "4.56" i need to be able to convert this to myfloat := 4.56
or even going from mystring := "456" to myinteger := 456 would be a start.

any help you can offer would be much appreciated and save me alot of pain and
suffering...

also, please EMAIL me as I dont have a local news server and dejanews is a
pain to use... thanks...

Jared

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

* Re: Converting Strings to Floats and/or Integers
  1998-08-26  0:00 Converting Strings to Floats and/or Integers mrpinga
@ 1998-08-26  0:00 ` Samuel Tardieu
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Tardieu @ 1998-08-26  0:00 UTC (permalink / raw)
  To: mrpinga

>>>>> "Jared" == mrpinga  <mrpinga@my-dejanews.com> writes:

Jared> if mystring := "4.56" i need to be able to convert this to
Jared> myfloat := 4.56 or even going from mystring := "456" to
Jared> myinteger := 456 would be a start.

   declare
      F : Float;
      I : Integer;
   begin
      F := Float'Value ("4.56");
      I := Integer'Value ("456");
   end;

  Sam
-- 
Samuel Tardieu -- sam@ada.eu.org




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

end of thread, other threads:[~1998-08-26  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-26  0:00 Converting Strings to Floats and/or Integers mrpinga
1998-08-26  0:00 ` Samuel Tardieu

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