Pass-By-Reference question. [message #38510] |
Wed, 10 March 2004 01:19  |
timrobishaw
Messages: 16 Registered: June 2003
|
Junior Member |
|
|
Hi there,
I've been using _REF_EXTRA for a long time now and have come to
appreciate that values of keywords sent to a module with the
_REF_EXTRA mechanism will override any keywords that are set inside
the module. Here is a great example:
pro whaddup, _REF_EXTRA=_extra
plot, [0], [0], /NODATA, XRANGE=[-5,5], YRANGE=[-5,5], PSYM=4,
_EXTRA=_extra
end
IDL> whaddup
I see what the module asked for: axes from -5 to 5 with no datum
plotted.
Now I can override the XRANGE and YRANGE keyword values by passing
them by reference...
IDL> whaddup, XRANGE=[-1,1], YRANGE=[-1,1]
I see what I asked for: axes from -1 to 1.
However, if I send NODATA set to ZERO, i.e., I'd really like to see my
datum this time...
IDL> whaddup, XRANGE=[-1,1], YRANGE=[-1,1], NODATA=0
I don't get what I asked for. The value for NODATA sent by reference
does not override the value set inside the module. This is also true
for the /NOERASE keyword.
IDL newsgroup: whaddup?
|
|
|
Re: Pass-By-Reference question. [message #38575 is a reply to message #38510] |
Fri, 12 March 2004 13:57   |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Thu, 11 Mar 2004 19:37:22 -0600, Craig Markwardt wrote:
>
> Mark Hadfield <m.hadfield@niwa.co.nz> writes:
>
>> Christopher Lee wrote:
> ...
>>> help, make_array(dimension=[2],value=0.0,double=1,_EXTRA={double:0 })
>>> <Expression> DOUBLE = Array[2]
>>> IDL> help, make_array(dimension=[2],value=0.0,double=0,_EXTRA={double:1 })
>>> <Expression> DOUBLE = Array[2]
>>
>> Nice work. These occur in 6.0 and 5.6, which are the only versions I have.
>>
>> It's a bug. Who's going to report it?
>
> It's not like I can pretend to know what's going on, as my previous
> post already evidenced. But, I can say that the above MAKE_ARRAY()
> behavior exists in IDL 5.5, 5.4, 5.2, 5.1, 5.0, and 4.0.1!!!
Haven't had time to play with this one, but I thought I'd point out
that _REF_EXTRA is a red-herring here: the same problem occurs with
regular _EXTRA. I suspect it has to do with the fact that built-in
IDL routines must explicitly process inherited keywords and manually
implement overriding, rather than some magical process by which they
are overridden. I elect O.P. to send in a bug report ;). You might
get a mug out it.
JD
|
|
|
Re: Pass-By-Reference question. [message #38637 is a reply to message #38510] |
Thu, 18 March 2004 17:50  |
timrobishaw
Messages: 16 Registered: June 2003
|
Junior Member |
|
|
Hi Mark,
Thanks for the heads-up. My yahoo account had become filled with
spam.
I will go ahead and report it; I've never reported a bug before, but
before I do, I have another one that I think is a bug. I'll post it
as a separate thread.
Thanks -Tim.
Mark Hadfield <m.hadfield@niwa.co.nz> wrote in message news:<c3aj7u$897$1@newsreader.mailgate.org>...
> Hi Tim
>
> Mailed this to you but message bounced, so posting on the group.
>
> I think we established that the behaviour you reported is
> an instance of a fairly widespread bug. Have you submitted a bug report?
|
|
|
Re: Pass-By-Reference question. [message #38663 is a reply to message #38510] |
Wed, 17 March 2004 14:25  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Hi Tim
Mailed this to you but message bounced, so posting on the group.
I think we established that the behaviour you reported is
an instance of a fairly widespread bug. Have you submitted a bug report?
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|