September 12, 2007

Debug, Debug, Debug

Filed under: Scripting — Marcus Tettmar @ 10:18 am

Many support requests and forum posts I see include a script snippet and a statement like “this value is wrong” or “the if statement says false but it should be true”. So we make an intelligent guess and say “so perhaps the value you are comparing isn’t what you think it is. Use the debugger”.

Stepping through the debugger reveals answers to problems like this quickly. Another way of checking values is to use a diagnostic message box. Whack a line like this into the script:

MessageModal>%MyVariable%

And see if MyVariable is what you are expecting.

Here’s an article I wrote some time ago on how to use the debugger.

http://www.mjtnet.com/blog/2006/05/17/use-the-debugger/

Use it. Debug. Debug. Debug. Please.