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

Home » Public Forums » archive » Why Output Keywords Fail in cgWindow
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
Why Output Keywords Fail in cgWindow [message #85416] Thu, 01 August 2013 08:30 Go to next message
David Fanning is currently offline  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 Go to previous messageGo to next message
Bob[4] is currently offline  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 Go to previous messageGo to next message
Fabzi is currently offline  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 Go to previous messageGo to next message
David Fanning is currently offline  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 Go to previous message
Fabzi is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Persistent environment variables (in DLM example)
Next Topic: IDL_IDLBridge: No gain?

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

Current Time: Wed Oct 08 15:14:36 PDT 2025

Total time taken to generate the page: 0.00586 seconds