(Go back to Scripting )
An essential part of writing any computer code is debugging it to ensure it runs as you intended. Here are some tips:
The "Check Syntax" button will help you find errors without having to run the script. The line and column of the error is displayed.
When a script cannot execute correctly an error number and description is displayed. Along with the line and column of the error, you can look in your code and attempt to find the problem. You'll also see a string saying "Occured while ...", to help you find what piece of code is causing the error.
Lines starting with a quote (') are comments. Use them to clarify what your code is trying to accomplish – they will greatly help you if you come back to a piece of code you haven't touched in a while.
While debugging, it can be useful to know the value of some variables. For example, you might use a msgbox call to let you know how your code is proceeding. Remove or comment out any such debugging output once your code is working correctly.
VBScript only allows the variant data type whereas some functions in the creature object for example require a specific type. If you get a type mismatch error, try using extra parentheses to force a conversion. For example:
Cr.FunctionName (Variable1), (Variable2), (Variable3)