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

Home » Public Forums » archive » Re: _EXTRA inheritance crashing IDL
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: _EXTRA inheritance crashing IDL [message #30194] Wed, 10 April 2002 21:42 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mark Hadfield (m.hadfield@niwa.co.nz) writes:

> But Rob was trying to supply keywords to test1 and have them passed to
> test2. And the way he did it is valid according to the IDL docs. See
> heading "Keyword Inheritance", subheading "Selective Keyword
> Redirection", where they give the example
>
> PRO SOMEPROC, _REF_EXTRA = ex
> ONE, _EXTRA=['MOOSE', 'SQUIRREL']
> TWO, _EXTRA='SQUIRREL'
> END
>
> (Yes, it is odd that the variable name ex is not used.)

Well, there you go. I need to spend less time playing
tennis and more time reading the manual. :-(

Cheers,

David

P.S. Let's just say a well-exercised body leads to
a limber mind. :-)

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: _EXTRA inheritance crashing IDL [message #30196 is a reply to message #30194] Wed, 10 April 2002 20:44 Go to previous messageGo to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.171e9d5d95b9c99c98987f@news.frii.com...
> Rob Preece (Rob.Preece@msfc.nasa.gov) writes:
>> Has anyone seen a behavior where IDL 5.5 crashes on a call to a
>> subroutine with an added _EXTRA keyword? I have found the same
>> behavior on several different machines, Linux and Mac, which does
>> not exist under 5.4.
>
> Well, yes, it crashes IDL 5.5, but not IDL 5.4. But I don't think
> you can hold RSI responsible for using their keyword inheritance
> mechanism in such a bogus way. Formatting the keywords you want to
> pass as a structure (the way this was meant to work) is error free:
>
> PRO test1, _REF_EXTRA = extra
> testStuff = {TITLE:'bob',XTITLE:'jim',YTITLE:'mary'}
> test2, INDGEN (10), _Extra=Create_Struct(testStuff, 'XRange',[0,5])
> END

But Rob was trying to supply keywords to test1 and have them passed to
test2. And the way he did it is valid according to the IDL docs. See
heading "Keyword Inheritance", subheading "Selective Keyword
Redirection", where they give the example

PRO SOMEPROC, _REF_EXTRA = ex
ONE, _EXTRA=['MOOSE', 'SQUIRREL']
TWO, _EXTRA='SQUIRREL'
END

(Yes, it is odd that the variable name ex is not used.)

--
Mark Hadfield
m.hadfield@niwa.co.nz Ka puwaha et tai nei
http://katipo.niwa.co.nz/~hadfield Hoea tatou
National Institute for Water and Atmospheric Research (NIWA)
Re: _EXTRA inheritance crashing IDL [message #30198 is a reply to message #30196] Wed, 10 April 2002 19:05 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rob Preece (Rob.Preece@msfc.nasa.gov) writes:

> OK, Rob de-lurking here.

Oh, good. :-)

> Has anyone seen a behavior where IDL 5.5 crashes on a call to a subroutine
> with an added _EXTRA keyword? I have found the same behavior on several
> different machines, Linux and Mac, which does not exist under 5.4. Here
> goes a test case:
>
> PRO test1, _REF_EXTRA = extra
>
> testStuff = ['TITLE','XTITLE','YTITLE']
>
> test2, INDGEN (10), _EXTRA = [testStuff, 'XRANGE']
>
> END
>
> PRO test2, plotStuff, _EXTRA = extra
>
> PLOT, plotStuff, plotStuff, _EXTRA = extra
>
> END
>
>
> Compile and execute :
>
> IDL> test1, XRANGE = [-1, 10]
>
> On 5.4, I get a nice plot, with my new XRANGE. On 5.5, I get a *totally
> irrelevant* error message:

Well, yes, it crashes IDL 5.5, but not IDL 5.4. But I
don't think you can hold RSI responsible for using their
keyword inheritance mechanism in such a bogus way.
Formatting the keywords you want to pass as a structure
(the way this was meant to work) is error free:

PRO test1, _REF_EXTRA = extra
testStuff = {TITLE:'bob',XTITLE:'jim',YTITLE:'mary'}
test2, INDGEN (10), _Extra=Create_Struct(testStuff, 'XRange',[0,5])
END

PRO test2, plotStuff, _EXTRA = extra
PLOT, plotStuff, plotStuff, _EXTRA = extra
END

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: _EXTRA inheritance crashing IDL [message #30205 is a reply to message #30198] Wed, 10 April 2002 15:41 Go to previous messageGo to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Rob Preece" <Rob.Preece@msfc.nasa.gov> wrote in message
news:Rob.Preece-1004021625170001@biggamma.nsstc.nasa.gov...
> OK, Rob de-lurking here.
>
> Has anyone seen a behavior where IDL 5.5 crashes on a call to a
> subroutine with an added _EXTRA keyword? I have found the same
> behavior on several different machines, Linux and Mac, which does
> not exist under 5.4. Here goes a test case:
>
> PRO test1, _REF_EXTRA = extra
>
> testStuff = ['TITLE','XTITLE','YTITLE']
>
> test2, INDGEN (10), _EXTRA = [testStuff, 'XRANGE']
>
> END
>
> PRO test2, plotStuff, _EXTRA = extra
>
> PLOT, plotStuff, plotStuff, _EXTRA = extra
>
> END

It crashes for me too (IDL 5.5, Windows 2000). IDL quits
immediately--I don't get a chance to see any error messages.

I have never had a crash before related to keyword inheritance in IDL
5.5, though I use keyword inheritance extensively. But then I never
use the idiom you do in test1, ie. passing a string array to
_EXTRA. (One of the reasons I do not do this is that it does not
support keyword abbreviations.) Can you do without it? Ie:

PRO test1, _REF_EXTRA = extra
test2, INDGEN (10), _EXTRA=extra
END

or in IDL 5.5 only:

PRO test1, _REF_EXTRA = extra
test2, INDGEN (10), _STRICT_EXTRA=extra
END
--
Mark Hadfield
m.hadfield@niwa.co.nz Ka puwaha et tai nei
http://katipo.niwa.co.nz/~hadfield Hoea tatou
National Institute for Water and Atmospheric Research (NIWA)
Re: _EXTRA inheritance crashing IDL [message #30269 is a reply to message #30198] Thu, 11 April 2002 13:21 Go to previous message
Rob.Preece is currently offline  Rob.Preece
Messages: 8
Registered: December 1999
Junior Member
In article <MPG.171e9d5d95b9c99c98987f@news.frii.com>, david@dfanning.com wrote:

> Rob Preece (Rob.Preece@msfc.nasa.gov) writes:
>
>> OK, Rob de-lurking here.
>
> Oh, good. :-)
>
<snip>
>
> Well, yes, it crashes IDL 5.5, but not IDL 5.4. But I
> don't think you can hold RSI responsible for using their
> keyword inheritance mechanism in such a bogus way.
> Formatting the keywords you want to pass as a structure
> (the way this was meant to work) is error free:
>
> PRO test1, _REF_EXTRA = extra
> testStuff = {TITLE:'bob',XTITLE:'jim',YTITLE:'mary'}
> test2, INDGEN (10), _Extra=Create_Struct(testStuff, 'XRange',[0,5])
> END
>
> PRO test2, plotStuff, _EXTRA = extra
> PLOT, plotStuff, plotStuff, _EXTRA = extra
> END
>
> Cheers,
>
> David


Thanks David,

But:

I have a *very* good reason for doing it this way (otherwise, why bother!
;) I have a set of keywords to pass on to an embedded plot routine, and I
can't know at the time what their values will be. I have a plot zooming
function in a widget (object) that simply calls the object's 'PLOT'
method, passing new x and y ranges. The plot method does some stuff, and
then hands it all off to the IDL (direct) PLOT routine, adding in the
'XRANGE' and 'YRANGE' keywords so that they can be overridden when the
'ZOOM' method is invoked. Very much like 'test1' in my sample code. Since
I followed the documentation as Mark H. mentioned, is this a valid bug in
IDL? How to proceed?

Maybe I'll just go for a beer (unfortunately, no good Colorado brews make
it into Alabama!)...

- Rob
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Finding the Non-Matching elements in two vectors
Next Topic: Examine "Saved" IDL procedures now too!

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

Current Time: Fri Oct 10 06:13:10 PDT 2025

Total time taken to generate the page: 0.56527 seconds