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

Home » Public Forums » archive » Re: how to tell it is character or it is number?
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: how to tell it is character or it is number? [message #55218 is a reply to message #55213] Tue, 07 August 2007 08:38 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
> Is there a way I can tell whether it is numbers or it is characters?
> 'fix' command can convert the numbers, it will give an error message
> then continue to the execution.

There are lots of programs around to do this, with two variants. The
first tests, as you suggest, whether IDL can convert the string into a
numeric value

http://idlastro.gsfc.nasa.gov/ftp/pro/misc/strnumber.pro

But IDL will consider the string '1qz_3' to be a valid number (=1) so
if you want a more usual interpretation, you need a more detailed
test of whether the ordering of digits, letters and decimal points
make sense as in

http://idlastro.gsfc.nasa.gov/ftp/pro/misc/valid_num.pro

--Wayne
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Basic Event Handling
Next Topic: question regarding 3d plotting

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

Current Time: Sun Nov 30 15:15:27 PST 2025

Total time taken to generate the page: 0.02761 seconds