Insert Debugging Instructions in Templates and Scripts
To debug your template or script, you must first insert a DEBUG instruction in the template, resource, or script. Then, you must test assemble the template (or test the resource or script). Finally, you must enable debugging in the test assembly window.
To debug your template or script using a certain set of answers, first test assemble the template using those answers and then save your answers in a test answer file. (See Use a Test Answer File.) Once you have done this, then complete the steps below.
You can insert a DEBUG instruction:
- In a text template.
- In a form template.
- In a script.
- In a resource.
To insert a DEBUG instruction
- Open the text or form template for editing. (See Edit a Template.)
- Complete the following steps, depending on where you need to insert the DEBUG instruction:
- If you are inserting a DEBUG instruction in a text template, place your cursor where you want to begin debugging. Click the HotDocs menu and choose Other Field from the list of options. Choose DEBUG from the Field type drop-down list . Click OK.
For WordPerfect Users: The HotDocs menu does not appear in WordPerfect. To insert a debug statement, manually type «DEBUG» into the template.
-
- If you are inserting a DEBUG instruction in a form template, create a field on the form where you want to begin debugging. Select the field and click the Field Properties button. In the Variable field, type DEBUG. (Close the Field Properties dialog box when you are finished.)
- If you are inserting a DEBUG instruction in a script, edit the computation or dialog whose script you want to debug. Insert the DEBUG instruction at the place in the script where you want to begin debugging.
- If you are inserting a DEBUG instruction in a resource, edit the component whose resource you want to debug. Insert the «DEBUG» instruction at the place in the resource text where to want to begin debugging.
- Click the Test Assemble button. (If debugging a resource or script, click the Test button.) The test assembly window appears, along with the HotDocs Debugger window, which stops at the field following the DEBUG instruction. (If the Debugger window does not appear, make sure debugging is enabled by clicking the Enable Debugging button in the assembly window toolbar.)
- Step through the template, resource, or script using the Debugger. (See Step Through a Template or Script.)