| Re: Format codes in IDL [message #31211 is a reply to message #31077] |
Wed, 19 June 2002 07:54   |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
astib@cc.usu.edu (Asti Bhatt) writes:
> No, if I do like -
> IDL>x = !values.f_nan
> IDL> read,format = '(3f10.3)', b
> and if in the input i give x, it will give me an error. Not only NaN,
> but if I say x=2 and try to give it as input to read with format
> specified, it will give me error. And this is typical to Macintosh. I
> tried same thing under Linux and it works fine. Actually I have a .dat
> file from which I need to read data, there are some NaN's also, and on
> macintosh, it refuses to read it by giving this error - %Unable to
> apply format code blah blah to 'variable'(whatever it is).
You mean that you're reading in from the keyboard, and instead of typing in a
number, you type in the character name of an IDL variable? That certainly
doesn't work on my machine under 5.4. Was this something added to 5.5? I get
IDL> x=3
IDL> read,format='(3f10.3)',b
: x
% Unable to apply format code F to input: "x".
% Execution halted at: $MAIN$
I'm very confused,
Bill Thompson
> Do you know if rsi has any patch for this ? I searched the website for
> this, but couldn't get anything.
> Thanks,
> Asti
> thompson@orpheus.nascom.nasa.gov (William Thompson) wrote in message news:<aeo3f4$3g1$1@skates.gsfc.nasa.gov>...
>> astib@cc.usu.edu (Asti Bhatt) writes:
>>
>>> Hi everybody,
>>
>>> I am having a problem applying format codes to 'NaN', i.e.
>>> !VALUES.F_NAN. When I try to assign this value to some variable and
>>> read it from the command line in Macintosh and Linux, it gives me
>>> error that 'Format code ... cannot be applied to 'variable'. It gives
>>> it for all format codes. The interesting thing is, I have one such
>>> statement in my code, it runs okay under Linux machine, but crashes
>>> under Macintosh. I do not understand this. If anybody has got any
>>> experience regarding the same and would help me, I would appreciate
>>> that.
>>
>> I'm not sure what you mean. Do you mean that if you do something like
>>
>> IDL> a = !values.f_nan
>> idl> READ, prompt='Input A: ', a, format='(F10.7)'
>>
>> that it will cause an error?
>>
>> Bill Thompson
|
|
|
|