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

Home » Public Forums » archive » Testing validity of numerical content of a string
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: Testing validity of numerical content of a string [message #51822 is a reply to message #51744] Thu, 07 December 2006 10:08 Go to previous messageGo to previous message
Bob[3] is currently offline  Bob[3]
Messages: 60
Registered: December 2006
Member
On Dec 7, 12:43 pm, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
> The odd thing about this is what IDL will do without complaining. IDL
> will do this without any error:
>
> IDL> help, float('0.0hello5')
> <Expression> FLOAT = 0.00000
>
> but draws the line at:
>
> IDL> help, float('hello5')
> % Type conversion error: Unable to convert given STRING to Float.
> % Detected at: $MAIN$
> <Expression> FLOAT = 0.00000

Looks like Sven's regex is close to what IDL is doing. (except that
both '+' and '-' are accepted and any exponent can have any number of
digits, try e.g. help, float(' +5e00001hello')
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: creating MPEG in IDL
Next Topic: changing widget_button values can be very slow

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

Current Time: Sat Oct 18 02:36:48 PDT 2025

Total time taken to generate the page: 0.72515 seconds