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 #55209] Tue, 07 August 2007 10:59 Go to previous message
queiny is currently offline  queiny
Messages: 15
Registered: November 2005
Junior Member
Many thanks!!

I think both of your suggestions work for me. Someone also suggest use
function 'byte' to see whether it is number or character.

>> http://idlastro.gsfc.nasa.gov/ftp/pro/misc/valid_num.pro
>
> I would just try stregex. From what you've shown so far, all it would
> take is this:
>
> if stregex( string, '[^0-9]', /boolean ) then ; this not numeric
> else ; this is numeric
>
> that is assuming, of course, that the numeric data you will be
> checking only contains the numbers 0-9. If you have negative signs,
> or decimal points, or whitespace, then above regular expression will
> have to be adjusted accordingly.
[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: Fri Oct 10 22:29:35 PDT 2025

Total time taken to generate the page: 0.64142 seconds