comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: floats from strings... duh!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: floats from strings... duh! [message #4357 is a reply to message #4355] Fri, 26 May 1995 00:00 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
afl@cdc.noaa.gov (Andy Loughe) writes:

> In article <3q4tku$iqu@dux.dundee.ac.uk>, pjclinch@dux.dundee.ac.uk (Pete
> Clinch) writes:
> |>
> |> I'm sure I'm missing something obvious... want to do the equivalent of a
> |> C sscanf or atof on a string I've got in a PV~Wave program that has a
> |> floating point number in string form.
> |>
> |> Rather than write my own function to convert "1.234" to 1.234, is there a
> |> way in the system to do it easily?
> |>
> |> Thanks.
> |>
> |> Pete.
> |> --
> |> Peter Clinch Dundee Teaching Hospitals NHS Trust
> |> voice: 44 1382 660111 x 3637 snail: Directorate of Medical Physics
> |> fax: 44 1382 640177 Ninewells Hospital
> |> email: p.j.clinch@dundee.ac.uk Dundee DD1 9SY Scotland UK


> Again, I may be missing the boat here, but is this what you want?

> IDL> a = '1.234'
> IDL> b = float(a)
> IDL> help, b
> B FLOAT = 1.23400

In IDL, there's also a routine called READS, which works like READ or READF,
except that the input is a string instead of the keyboard or a file. Thus, one
could do things like

READS, '1.23 4.56 7.89', X, Y, Z

and can even use FORMAT statements. I don't know if this also exists in
PV-Wave or not.

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Help for non-RSI libraries under IDL 4.0
Next Topic: Shading a band of ranges in pvwave

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Mon Dec 01 02:49:12 PST 2025

Total time taken to generate the page: 1.93196 seconds