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

Home » Public Forums » archive » Capturing print command output
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
Capturing print command output [message #63624] Mon, 17 November 2008 05:28 Go to next message
Nicolas is currently offline  Nicolas
Messages: 15
Registered: September 2007
Junior Member
Hi folks,

I have an interesting problem for you to solve! :)

What I am trying to do is to capture the expressions output by a
routine containing IDL 'print' commands.
Of course without modifing the code of this routine (no 'printf').

I have though about the following solutions:
1- Make a wrapper of the routine that what to execute
2- Make a sort of 'buffer listener' that can restore its content on
demand
3- Temporarily redirect the standard output of the 'print' command

None of them seems to be conclusive. Do you have any other ideas?

Cheers,
Nicolas
Re: Capturing print command output [message #63724 is a reply to message #63624] Mon, 17 November 2008 21:27 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Nov 17, 8:28 am, Nicolas <primese...@gmail.com> wrote:
> Hi folks,
>
> I have an interesting problem for you to solve! :)
>
> What I am trying to do is to capture the expressions output by a
> routine containing IDL 'print' commands.
> Of course without modifing the code of this routine (no 'printf').
>
> I have though about the following solutions:
> 1- Make a wrapper of the routine that what to execute
> 2- Make a sort of  'buffer listener' that can restore its content on
> demand
> 3- Temporarily redirect the standard output of the 'print' command
>
> None of them seems to be conclusive. Do you have any other ideas?

If you go for the 'wrapper' approach, you might consider PRINTLOG,
which is a drop-in replacement for PRINT, with logging.

Craig
PRINTLOG found here:
http://cow.physics.wisc.edu/~craigm/idl/io.html
Re: Capturing print command output [message #63746 is a reply to message #63624] Mon, 17 November 2008 09:58 Go to previous message
Abraham campbell is currently offline  Abraham campbell
Messages: 10
Registered: January 2008
Junior Member
On Nov 17, 9:14 am, Paolo <pgri...@gmail.com> wrote:
> Nicolas wrote:
>> On Nov 17, 3:52 pm, Brian Larsen <balar...@gmail.com> wrote:
>>> This certainly doesn't meet all of your requirements but journal might
>>> meet some (enough) of your needs with zero effort?
>
>>> Cheers,
>
>>> Brian
>
>>> ------------------------------------------------------------ --------------
>>> Brian Larsen
>>> Boston University
>>> Center for Space Physicshttp://people.bu.edu/balarsen/Home/IDL
>
>> Indeed but I could be a nice workaround.
>> I realized that what I need is actually a pipe for redirecting IDL
>> routine/function standard output
>
> On UNIX like system you can certainly do
> idl > log.txt
> and variations thereof.
> Ciao,
> Paolo
>
>
>
>> Anyway, thank you very much!

You can also redirect IDL output with the Windows Command line app,
e.g.
> idl.exe > idl.out
Re: Capturing print command output [message #63753 is a reply to message #63624] Mon, 17 November 2008 08:14 Go to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Nicolas wrote:
> On Nov 17, 3:52�pm, Brian Larsen <balar...@gmail.com> wrote:
>> This certainly doesn't meet all of your requirements but journal might
>> meet some (enough) of your needs with zero effort?
>>
>> Cheers,
>>
>> Brian
>>
>> ------------------------------------------------------------ --------------
>> Brian Larsen
>> Boston University
>> Center for Space Physicshttp://people.bu.edu/balarsen/Home/IDL
>
> Indeed but I could be a nice workaround.
> I realized that what I need is actually a pipe for redirecting IDL
> routine/function standard output

On UNIX like system you can certainly do
idl > log.txt
and variations thereof.
Ciao,
Paolo

>
> Anyway, thank you very much!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: data to image? Please help...
Next Topic: ASTER Data

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

Current Time: Wed Oct 08 14:00:32 PDT 2025

Total time taken to generate the page: 0.01750 seconds