Resolving Errors in Scripts
The JADE Report Writer script facility enables you to resolve any code errors on the fly.
When you have created your script and you click the Save button on the Add Script Field dialog, the Errors sheet is automatically displayed if your script code contains one or more errors. Only the first error is displayed on the Errors sheet. Once you have reviewed the error, you can switch back to your code on the Script Code sheet and make any corrections that are required. Any subsequent error is then displayed in turn, as you click the Save button to reapply your modified code.
A typical error is shown in the following image.
You can view your script with line numbers down the left-hand side by right-clicking on the Script Code sheet and selecting the Line Numbers options.
In the previous image, the Incompatible types error is displayed because the result is declared as a decimal while the code is attempting to assign a string. This is probably the most common error you will encounter. In all cases in which the Errors sheet is displayed, perform the following actions to correct errors in your script code.
-
Make sure that you understand what has caused the error. The common errors that you could encounter are described in "Script Errors", later in this section.
-
Click the Script Code tab to display the Script Code sheet again.
-
Correct the code that is in error.
-
Click the Save button on the Add Script Field dialog.
If there are further errors, the Errors sheet is displayed again. Perform steps 1 through 4, until you have resolved all errors.