Re: Capturing stdoutput [message #11826 is a reply to message #11636] |
Fri, 22 May 1998 00:00  |
Alex Schuster
Messages: 124 Registered: February 1997
|
Senior Member |
|
|
Bernard Puc wrote:
> I am looking for ideas on how to implement the following: I have a
> widget application and I want to display whatever output various
> procedures/functions usually write to the output log window in a text
> window in the application. Any hints are welcome.
Any hints? Okay, then you could do a find and replace in each .pro file
your program needs, and replace print with printlog where printlog is a
procedure like this:
pro printlog var1, var2, var3, var4, var5, var6, var7, var8, var9, var10
text = ''
for i = 1, n_params() do $
foo = execute( 'text=text+string(var' + strtrim( i, 1 ) + ')' )
widget_control, log_id, /append, set_value=text
end
I concatenates all the given parameters to one string, and appends it in
the log widget. This worked fine for me, but if you cannot modify the
routines, or if they are written in C/Fortran, it wouldn't help you.
You can redirect the complete output by starting IDL via 'idl >
logfile', but you cannot access this file in IDL because it has be be
closed first.
Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
|
|
|