
37
10
Script Debugging
If you have delved into writing your own scripts you will inevitably have to debug them -
if only to root out spelling or other minor syntax errors. Programming and debugging go
hand in hand. Fortunately there are a couple of very useful tools to aid you in your time
of need.
10.1 - Finding Compiler Errors
The “jump to error” feature in the Script Editor allows you to click on a reported
compiler error in the Main GP16P window to jump to the line in the Script near or where
the error is present. This feature is handy for tracking down bugs in scripts that will not
compile. A word of caution, there are literally endless ways to write bad code, so this
feature will usually get you close to the line with an error and not on the exact error. Also
the Script Editor lacks a line number feature so it can be difficult to count lines out,
especially in large scripts.
Clicking right on the compiler ERROR line shown above will cause the Script Editor to
highlight the approximate error location – shown below.
<< The highlighted line is ok –error is just above it.
10.2 - Third Party Editors
If you plan on doing a lot of scripting you might consider using a third party
programming editor. + is a nice freeware editor. When you open a GP script in
+, you can choose a “Language” skin, like “Flash actionscript”, that will give
you line numbers and a context sensitive text color scheme. You will still have to open
the file in the GP16P tool before you compile – be sure to Save in the editor first.
Do an internet search for “+” to download this editor.