Re: Minor obscure error message [message #91816 is a reply to message #91815] |
Tue, 01 September 2015 14:50   |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
Hi Wayne,
I think this is why: if there is an "&" indicating multiple statements, then "implied print" is not attempted at all on any of them. In your first example, IDL tried to interpret it as a method call on !p (and failed, with no message), then tried to interpret it as an implied print, and failed. Second time, IDL tried as a method call on !p, and that failed. Due to the "&", it did not try implied print, so it reported the first failure.
Here's a simpler example to show a similar effect:
IDL> !Pi
3.1415927
IDL> !Pi & !DPi
% Attempt to call undefined procedure: '!PI'.
Cheers,
-Dick
Dick Jackson Software Consulting Inc.
Victoria, BC, Canada --- http://www.d-jackson.com
On Tuesday, 1 September 2015 12:12:35 UTC-7, wlandsman wrote:
> Suppose one wants to write !p.thick=2 but forgets the equals sign
>
> IDL> !p.thick2
> % Tag name THICK2 is undefined for structure !PLT.
> % Execution halted at: $MAIN$
>
> and one gets a very logical error message.
>
> But if one precedes this with the syntactically correct statement !p.background=0
>
> IDL> !p.background=0 & !p.thick2
> % Object reference type required in this context: <STRUCT Array[1]>.
> % Execution halted at: $MAIN$
>
> one gets an obscure reference about requiring an object type. I'm not sure how IDL is getting confused here. It only happens when the two statements are on the same line.
>
> IDL> print,!version
> { x86_64 linux unix linux 8.4 Sep 27 2014 64 64}
>
>
> --Wayne
|
|
|