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

Home » Public Forums » archive » procedure in case statement
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: procedure in case statement [message #82139 is a reply to message #82049] Mon, 19 November 2012 07:52 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hmm. Not really. This is what I get (on the command line):

IDL> read,rot,prompt='rot via proc one or two? (1 or 2)'
rot via proc one or two? (1 or 2)3
IDL> help, rot
ROT FLOAT = 3.00000

So, you can see it assumes "rot" is a float by default.

Now let's try a string:

IDL> read,rot,prompt='rot via proc one or two? (1 or 2)'
rot via proc one or two? (1 or 2)proc_one
% READ: Input conversion error. Unit: 0, File: <stdin>
% Execution halted at: $MAIN$

Oops. So, DavidF was correct. You have to cast the variable as a string
before you use it as such:

IDL> rot=""
IDL> read,rot,prompt='rot via proc one or two? (1 or 2)'
rot via proc one or two? (1 or 2)proc_one
IDL> help, rot
ROT STRING = 'proc_one'


IDL> print, !version
{ x86 linux unix linux 8.2 Apr 10 2012 32 64}


cheers,

paulv

On 11/19/12 10:46, hannah_ue@web.de wrote:
> thanks for your answer. i do it exactly like you suggested, but always get the error "read: input conversion error. unit: 0, file:<stdin>"
> do you have an idea what could be wrong?
>
> thanks, hannah
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Can't get out of define mode in ncdf, not specific to variable.
Next Topic: Can't get out of define mode in ncdf, not specific to variable.

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

Current Time: Fri Oct 10 04:50:22 PDT 2025

Total time taken to generate the page: 0.48288 seconds