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

Home » Public Forums » archive » converting strings into numerical or string data depending on the contents
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
converting strings into numerical or string data depending on the contents [message #81583] Tue, 02 October 2012 16:09
M. Katz is currently offline  M. Katz
Messages: 69
Registered: May 2005
Member
I'm looking for a way to elegantly transform string values:
(a) keeping it as string-type when the string does not contain only numbers
(b) convert into numeric-type data when appropriate.

The basic IDL type-casting routines {fix(), double(), etc.} spit out string-conversion complaints (non-fatal errors) whenever I apply them to arbitrary 'non-numerical' strings.

Is there a better way to do this than stregex()? (That is, am I going to have to learn to use stregex() to accomplish this filtering?)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL Spawn on Windows OS
Next Topic: Re: converting strings into numerical or string data depending on the contents

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

Current Time: Fri Oct 10 13:31:23 PDT 2025

Total time taken to generate the page: 0.72433 seconds