When you write scripts you can make various errors: syntax, semantic, errors in script logic. Syntax errors are easy to notice as Script Editor features syntax highlighting and it underlines errors.
When you try to generate a document ok when you check scripts syntax and semantic errors will be listed in a specific error list.
(You can check scripts by the menu command “Report\Check Script” or by clicking “Check Script” button on the toolbar).
The list contains name of the band the error is contained in and its description. Double click on the list item and you will run Script Editor to edit script or expression.
To debug scripts, it is possible to display value of necessary variables in control points, for example, by using the following dialog: System.Windows.Forms.MessageBox(var1.ToString()).
We strongly recommend avoiding sophisticated logic in scripts; using only base functionality. If scripts are too sophisticated you need to review concept of the report template.
If you need to debug sophisticated logic of calculations, you can use a workaround. All such logic can be separated in a function(s). These functions are included in the application and scripts refer to the application for the required calculations. In the application, you can use debugger of the development environment you use. After you debugged the logic you can get function back to script code if you need to make template independent from the application.
debugging script error