Debug VBScript - OCR for AnyDoc - Foundation 23.1 - Foundation 23.1 - AnyDoc - external

OCR for AnyDoc Programming Reference Guide

OCR for AnyDoc
Foundation 23.1

After code is successfully compiled, you are well on your way to finishing your VBScript project. At times, however, you may encounter a syntax error, such as a misspelled variable name or logic errors, such as a bug, in your code.

When you encounter such a situation, you can either examine the code itself, or you can use a script debugger, which is a program designed to aid you in locating the grammar and logic errors in your script. Before using the debugger, close all programs that host active scripting. You can find a list of these by clicking the Running Documents button on the debugger toolbar.

Activate Microsoft Script Debugger in two ways:

  • Enable Auto-Debug VBScript in the VBScript Management window (Management | VBScript Management). SeeVBScript Management (page VBScript Management). This causes every VBScript to open in the Microsoft Script Debugger each time it runs, whether you are processing a batch or running individual images through Interactive Processing. If you have multiple scripts on the template, this option is not recommended.

  • The alternative to the Auto-Debug VBScript option is to put a Stop at the script's beginning to debug. This causes the individual script to open in the Microsoft Script Debugger when it is run.

If the Microsoft Script Debugger is not already installed on your PC, seeInstall and Enable the Microsoft Script Debugger (page Install and Enable the Microsoft Script Debugger).

Always test your code thoroughly before implementation. A good test plan should:

  1. Include plenty of line data.
  2. Have some blank zones-see what happens if the zone is not populated.
  3. Be Verified just like the real operators do it; press [Page Up] and [Page Down] to ensure that your code can handle unexpected situations.

When you process a form, either through Interactive Processing or batch processing, that activates the Script Debugger, the script appears in the Microsoft Script Debugger window. The Microsoft Script Debugger provides read-only access to your code. To change the code, you need to open the VBScript window. Testing and debugging require programming experience. For additional help with the debugger interface, refer to its Help file.