Why Output Keywords Fail in cgWindow [message #85416] |
Thu, 01 August 2013 08:30  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
I had a question this morning that had to do with why output keywords
fail to produce the correct output when the command they are used with
is added to cgWindow. I've answered this question before, but I was
surprised to find I had never written an article about it. I have now.
The answer has to do with the way IDL commands are "played back" when
the graphics window is resized. I use CALL_PROCEDURE to replay the
commands that have been loaded into cgWindow. Unfortunately,
CALL_PROCEDURE does not have a mechanism for returning output keywords.
You can find a description of the problem and a simple workaround in
this article:
http://www.idlcoyote.com/cg_tips/outkeyword.php
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Why Output Keywords Fail in cgWindow [message #85432 is a reply to message #85416] |
Sat, 03 August 2013 03:30   |
Bob[4]
Messages: 24 Registered: April 2009
|
Junior Member |
|
|
On Thursday, August 1, 2013 9:30:50 AM UTC-6, David Fanning wrote:
> Unfortunately,
> CALL_PROCEDURE does not have a mechanism for returning output keywords.
This is not true. For example,
IDL> call_procedure, 'help', /MEMORY, OUTPUT=mem_out
IDL> print, mem_out
heap memory used: 1191740, max: 1192007, gets: 1125, frees: 281
|
|
|
Re: Why Output Keywords Fail in cgWindow [message #85468 is a reply to message #85432] |
Mon, 12 August 2013 02:34   |
Fabzi
Messages: 305 Registered: July 2010
|
Senior Member |
|
|
Hi,
On 08/03/2013 12:30 PM, bobnnamtrop@gmail.com wrote:
> On Thursday, August 1, 2013 9:30:50 AM UTC-6, David Fanning wrote:
>>> Unfortunately,
>>> CALL_PROCEDURE does not have a mechanism for returning output keywords.
> This is not true. For example,
>
> IDL> call_procedure, 'help', /MEMORY, OUTPUT=mem_out
> IDL> print, mem_out
> heap memory used: 1191740, max: 1192007, gets: 1125, frees: 281
I think it is more related to the use of _EXTRA keywords, isn't it?
IDL> help, _EXTRA={MEMORY:1, OUTPUT:mem_out}
% HELP: Expression must be named variable in this context: <STRING
Array[1]>.
% Execution halted at: $MAIN$
|
|
|
Re: Why Output Keywords Fail in cgWindow [message #85472 is a reply to message #85468] |
Mon, 12 August 2013 05:25   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Fabien writes:
> I think it is more related to the use of _EXTRA keywords, isn't it?
>
> IDL> help, _EXTRA={MEMORY:1, OUTPUT:mem_out}
> % HELP: Expression must be named variable in this context: <STRING
> Array[1]>.
> % Execution halted at: $MAIN$
Yes, it is related to the use of the _EXTRA keyword. Without saving
every keyword explicitly, and then calling it explicitly, there is no
way to recover the keyword value from Call_Procedure.
I could, of course, do something like this for a handful of graphics
commands (say, the Coyote Graphics commands), by turning the graphics
commands into objects. But, I envisioned cgWindow as a program that
could work with *any* IDL graphics command, even those that I didn't
write.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Why Output Keywords Fail in cgWindow [message #85473 is a reply to message #85472] |
Mon, 12 August 2013 05:41  |
Fabzi
Messages: 305 Registered: July 2010
|
Senior Member |
|
|
On 08/12/2013 02:25 PM, David Fanning wrote:
> I envisioned cgWindow as a program that
> could work with*any* IDL graphics command, even those that I didn't
> write.
I agree, and this is obviously a success. I don't see the problem of
output keywords as a big issue anymore. For most applications, simple
workarounds can be found.
Cheers
Fabien
|
|
|