Take a look at my fMsg() UDF so you don't add and remove lots of message code.

If you define a global $DEBUG and set it to a non-zero value, it can log some messages always and other only when debug is active. You can control if messages display on the console or only write to the log. I use it for almost all output, and often have dozens of messages with debug info in my code, all disappear when $DEBUG is 0. I even check the command line for "--d" to set $DEBUG to 1 so I can turn debug messages on dynamically.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D