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

Home » Public Forums » archive » Re: Reading * symbol out of a string
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
Re: Reading * symbol out of a string [message #66415] Mon, 11 May 2009 12:46
fugu is currently offline  fugu
Messages: 5
Registered: February 2009
Junior Member
On May 11, 6:53 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article
> < 91048f09-343c-4ffb-9e4f-b9caf8062...@r3g2000vbp.googlegroups .com >,
>
>
>
> fugu <daniel.hawel...@gmail.com> wrote:
>>> Did you do
>
>>> x = ''
>
>>> to ensure that it was a string before trying to read into it?
>
>> Yes, it is a string. I also check this during runtime (X STRING
>> = '*280 948 80 0')
>> is the output from help, x. The numbers do get read properly as well.
>
>> Thanks,
>
>> Daniel
>
> Sorry, my mistake.
>
> I meant
>
> stage = ''
>
> The default variable type for an undefined variable in a READ
> statement is FLOAT.
>
> Ken Bowman

yes, that's the one. Thanks a lot!

Daniel
Re: Reading * symbol out of a string [message #66416 is a reply to message #66415] Mon, 11 May 2009 10:53 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<91048f09-343c-4ffb-9e4f-b9caf80624f6@r3g2000vbp.googlegroups.com>,
fugu <daniel.hawellek@gmail.com> wrote:

>> Did you do
>>
>> x = ''
>>
>> to ensure that it was a string before trying to read into it?
>
>
> Yes, it is a string. I also check this during runtime (X STRING
> = '*280 948 80 0')
> is the output from help, x. The numbers do get read properly as well.
>
>
> Thanks,
>
> Daniel

Sorry, my mistake.

I meant

stage = ''

The default variable type for an undefined variable in a READ
statement is FLOAT.

Ken Bowman
Re: Reading * symbol out of a string [message #66418 is a reply to message #66416] Mon, 11 May 2009 09:43 Go to previous message
fugu is currently offline  fugu
Messages: 5
Registered: February 2009
Junior Member
> Did you do
>
> x = ''
>
> to ensure that it was a string before trying to read into it?


Yes, it is a string. I also check this during runtime (X STRING
= '*280 948 80 0')
is the output from help, x. The numbers do get read properly as well.


Thanks,

Daniel
Re: Reading * symbol out of a string [message #66419 is a reply to message #66418] Mon, 11 May 2009 09:17 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<39c8864a-a3f9-4022-8841-82ba2fb23aa2@z5g2000vba.googlegroups.com>,
fugu <daniel.hawellek@gmail.com> wrote:

> Dear all,
>
> I have a string x
>
> X STRING = '*280 948 80 0'
>
> which I am trying to read into variables:
>
> READS, x, stage, lat, lon, wind, press, format =
> '(A1,I3,1x,I3,1x,I3,1x,I4)'
>
> This returns % Type conversion error: Unable to convert given STRING
> to Float.
>
> and the problem seems to be the (ASCII decimal 42 mapped -) * symbol.
>
> I have tried to read it into various formats (replace A by I or F for
> instance), but none works.
>
> Has anyone got an idea, why that is and how to work around it?
>
> Many thanks!
>
> Daniel

Did you do

x = ''

to ensure that it was a string before trying to read into it?

Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Can IDL be used to generate microsoft word documents automatically?
Next Topic: Spline based ROIs

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

Current Time: Wed Oct 08 20:02:07 PDT 2025

Total time taken to generate the page: 0.37921 seconds