Re: interpreter access [message #19527] |
Thu, 06 April 2000 00:00 |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Thomas Fechner wrote:
>
> I want to clearify my wishes. I want to send a command to the IDL
> interpreter from some program (mostely widgets) and this command should
> be remembered with the JOURNAL command as all other commands which I
> type at the IDL prompt.
> Interpreter calls with call_procedure, call_function are not listed. Ok,
> every print output is in the log file but commented out and it will be a
> solution with some additional work. Any other ideas ?
> Thomas
> ------------------------------------------------------------ -------------
> Thomas Fechner tfechner@aip.de
> Astrophysikalisches Institut Potsdam
> An der Sternwarte 16
Ok: *that's* much easier than actually putting the text on the command
line!
The JOURNAL command accepts an argument which is interpreted as the
journal file name if no journal file is opened and interpreted as text
to put into the journal file
if it is open. With the !JOURNAL system variable you can do the test
yourself.
Here is a piece of code that should demonstrate what you need to do:
; cmdstr is the string you receive from your external call
if not !journal then begin
; assume that you want to stop if you can't find the journal file
; note it is not possible to append to an existing file unless you
; write your own journaling routines
Message,'Journal file not open!',/Continue
return
endif
call_procedure,cmdstr
journal,cmdstr
Viele Gruesse,
Martin
--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
|
|
|
Re: interpreter access [message #19551 is a reply to message #19527] |
Wed, 05 April 2000 00:00  |
Thomas Fechner
Messages: 1 Registered: April 2000
|
Junior Member |
|
|
I want to clearify my wishes. I want to send a command to the IDL
interpreter from some program (mostely widgets) and this command should
be remembered with the JOURNAL command as all other commands which I
type at the IDL prompt.
Interpreter calls with call_procedure, call_function are not listed. Ok,
every print output is in the log file but commented out and it will be a
solution with some additional work. Any other ideas ?
Thomas
------------------------------------------------------------ -------------
Thomas Fechner tfechner@aip.de
Astrophysikalisches Institut Potsdam
An der Sternwarte 16
|
|
|
Re: interpreter access [message #19570 is a reply to message #19551] |
Tue, 04 April 2000 00:00  |
Steven Chetelat (CS)
Messages: 11 Registered: February 2000
|
Junior Member |
|
|
On Tue, 4 Apr 2000, David Fanning wrote:
> Thomas Fechner (tfes@my-deja.com) writes:
>
>> my next task is to realize a GUI with IDL and I
>> want to call some external commands (C-programms,
>> shell scripts, IDL-functions etc.) from widgets
>> directly and (that's my problem) also copy these
>> commands to the IDL command window (interpreter
>> window). Is there any possibiltiy to access the
>> interpreter window from any IDL widgets and what
>> is to do therefore?
>
> The easiest way to gain access to the IDL command
> interpreter from any program is to use the "virtual
> functions": Call_Function, Call_Procedure, and Call_Method.
> And for what those don't do, there is good ol'
> Execute to mop up the rest. :-)
Also (assuming I understand the question), you can get whatever you
execute to print out to the command window simply using idl's print
statement, since all these functions take string arguments. There'll be
a little wrangling to get all the arguments to print out, but nothing too
rough.
K-Bye,
STEVE! (chetelat@csee.usf.edu)(steve@moffitt.usf.edu)
|
|
|
Re: interpreter access [message #19575 is a reply to message #19570] |
Tue, 04 April 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Thomas Fechner (tfes@my-deja.com) writes:
> my next task is to realize a GUI with IDL and I
> want to call some external commands (C-programms,
> shell scripts, IDL-functions etc.) from widgets
> directly and (that's my problem) also copy these
> commands to the IDL command window (interpreter
> window). Is there any possibiltiy to access the
> interpreter window from any IDL widgets and what
> is to do therefore?
The easiest way to gain access to the IDL command
interpreter from any program is to use the "virtual
functions": Call_Function, Call_Procedure, and Call_Method.
And for what those don't do, there is good ol'
Execute to mop up the rest. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|