A good programmer can often correct simple errors by simply inspecting the code, just as a good speller doesn’t need a dictionary or a spellchecker. But experienced programmers constantly use the Lingo Debugger whereas beginners don’t even seem to know it exists. Refer to Chapter 4, Troubleshooting, in Macromedia’s Learning Lingo manual for a brief overview.
The Debugger is a diagnostic tool. It does not debug your program for you any more than an X-ray cures disease. The Debugger can show you what Lingo commands are being executed and the values held in various variables. See also the Watcher window in Figure 3-4.
Figure 3-1. The Debugger Window
When Director compiles a script—see "Entering and Compiling Scripts“” in Chapter 1 and "Compiling Scripts" Chapter 2—it checks that your Lingo code has a recognizable structure and acceptable keywords. It does not attempt to actually run your Lingo code. Recompile to help find typographical errors.
A so-called compile-time or syntax error causes a dialog box to appear, indicating what Director suspects is wrong.
Figure 3-2. A Script Error Dialog
Script errors are your friends. Read the error message carefully; Director will tell you which line confused it.
Unfortunately, when you close the Script window (which ...