APGen Documentation Previous Topic: Editing APG Scripts Next Topic: Guidelines for Writing APG Scripts Parent Topic: APG Scripts    APG Scripts
Debugging APG Scripts
See Also:

Script Debuggers

APG scripts can be debugged using the Microsoft Script Debugger or Visual InterDev 98.  Visual InterDev 98 provides a more polished debugger, syntax highlighting, an HTML editor, and other benefits; it is the recommended debugger and editor for Active Page Generator. 

To debug scripts on Windows 2000 with Visual Interdev, Visual Studio 6.0 Service Pack 3 must be installed.  Debugging will not work on Windows 2000 without this service pack.  The latest service pack can be obtained at:

http://msdn.microsoft.com/vstudio/sp/

If you do not have Visual InterDev 98, you can use the Microsoft Script Debugger.  To download the Microsoft Script Debugger, visit:

http://msdn.microsoft.com/scripting/debugger/dbdown.htm

Debugging

To debug a script:

  1. Insert a VBScript Stop or a JScript debugger statement in a script block.  Or, cause a run-time error in a script block. 
  2. Run the script. 

Alternatively, you can debug a script by typing:

<script path> /b <other args...>

at the command line.  The /b switch tells APGen.exe to break into the debugger at the first line of execution in the script.

If a script debugger is installed on your computer and you have used one of these techniques to start debugging, then a dialog box will pop up, asking if you would like to debug the script.  Choose yes, and the debugger will run.  The Visual InterDev 98 debugger offers more features than the NT Option Pack debugger, but either debugger can be used.

If the Script.Debug property is false, VBScript Stop statements, JScript debugger statements, and run-time errors will not start the debugger.  It is normally desirable to turn debugging off when application development is complete.  The Script.Debug property gets its default value from the APGen.Debug property.  The APGen.Debug property gets its default value from a registry setting, so you can easily turn off script debugging for the entire computer.

Editing While Debugging

When debugging an APG script in Visual Interdev 98, you will notice that you can edit the script while debugging it.  These changes are not immediately incorporated into the running script, and the changes may throw off the debugger.  Edit-and-continue is not implemented, and is not possible with current Active Scripting technology.