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

Home » Public Forums » archive » Re: Suppressing diagnostic messages en masse
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Suppressing diagnostic messages en masse [message #47321 is a reply to message #47320] Thu, 02 February 2006 17:00 Go to previous messageGo to previous message
mmeron is currently offline  mmeron
Messages: 44
Registered: October 2003
Member
In article <1138927542.301363.217360@z14g2000cwz.googlegroups.com>, "Ed Hyer" <ejhyer@gmail.com> writes:
> Hey great minds,
>
> I am engaged in semi-permanent debugging of some pretty long scripts,
> which in the course of developing I have peppered with PRINT statements
> to achieve various diagnostic ends.
>
> I don't think the script is "final," whatever that means, but it's time
> to do some production runs, where the script will be invoked 10,000
> times, instead of the usual 1.
>
> I can do a search-and-replace to comment out the diagnostics for this
> purpose, but what would really be nice is if I could somehow put a
> keyword flag into the routine that, when set, would suppress|promote
> the diagnostic messages. Sounds like the sort of thing that might
> exist. Anyone know how to do this?
>
Just use a keyword flag, as you said.

1) Add to the call line of the routine something like ",diagnose = diag'

2) Add to the body of the routine "diflag = keyword_set(diag)'

3) Run search and replace, replacing every instance of "print," with
"if diflag then print,"

The choice of variable names is, of course, up to you.

Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Widget creation performance
Next Topic: !PATH variable, current directory, and .COMPILE problems

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

Current Time: Sun Oct 12 07:31:14 PDT 2025

Total time taken to generate the page: 0.47973 seconds