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 #47319 is a reply to message #47310] Thu, 02 February 2006 17:06 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Ed Hyer wrote:
> 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?

I don't know about "system" level keywords to do this, but I usually add a "Debug" keyword
to my procedures - particularly widget code, but other stuff too.

You should be able to do a supervised global search and replace so that
PRINT,
becomes
IF ( KEYWORD_SET(Debug) ) THEN PRINT,

However, if you have a lot of PRINTs, you might want to "block" them, e.g.

IF ( KEYWORD_SET(Debug) ) THEN BEGIN
PRINT, x
PRINT, y
PRINT, a,b,c
....
ENDIF

It depends on how you've written the code. Lots of "IF ( KEYWORD_SET(Debug) )..." lines
could slow things down a bit (and "a bit" multiplied by 10000 is a lot).

A sed or awk filter for the code might also be an option. That is, you run the code
through sed or awk to comment or uncomment the debug print statements depending on your need.

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
[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 19:26:06 PDT 2025

Total time taken to generate the page: 1.20003 seconds