|
How to Debug Scripts Written
for TPF Software Products

Users who write scripts for TPF Software products can debug
those scripts using the Microsoft Script Debugger. This page
tells you how to
Determine
whether the Script Debugger is Installed
Most users with Internet Explorer 4 or later will already
have the Script Debugger installed on their machines. To check
whether a script debugger is installed, do the following:
- Start Internet Explorer;
- Open the View menu on the Internet Explorer menu bar;
- If there is a menu item that reads "Script Debugger,"
a script debugger is installed on your machine.
Back to top
Obtain the Script
Debugger if You Need It
You can download
the Script Debugger for free from Microsoft's web site (the
links are below). WARNING! Make
sure to download and install the script "debugger" and not
the
script "engine." Another thing to be
careful of is that there are two versions of the Windows
Script Debugger, one for
Windows 98/ME and one for Windows NT 4.0/2000/XP. Please
download the version appropriate for your operating system.
After downloading, follow Microsoft's directions for installing
the Script Debugger.
Back to top
Enable
the Script Debugger after It is Installed
Some recent versions of the Script Debugger have been designed
by Microsoft so that the debugger window does not automatically
appear when there is a script problem. To change this behavior,
every time TPF/GI 2.6.1 starts up it will now override a Microsoft
registry setting so that you can debug your scripts using
the Microsoft Script Debugger.
If you are still working with TPF/GI 2.4.1 or 2.5.1, you
can do the following to enable the Script Debugger:
- Click
here to download the file JITDebug.reg;
- If you are given the choice by your browser, elect to
"Open this file from its current location;" otherwise,
after the file JITDebug.reg is downloaded, double click
it in Windows Explorer;
- Answer yes that you want to add information to the registry.
Once this is done, the Script Debugger window should appear
when your scripts have a problem or when execution hits a
breakpoint in your scripts.
Back to top
Use
Breakpoints in Your Scripts
Once the Microsoft Script Debugger is installed and enabled,
the Script Debugger window should appear whenever one of your
scripts has a problem.
You can force the Script Debugger window to appear containing
your script by placing a breakpoint in your script. In VBScript,
the way to do this is to place a "stop" statement
in the script. In JScript, the equivalent statement is the
"debugger" statement. Example scripts that use these
breakpoint statements are below.
Once the Script Debugger window has appeared containing your
script, you can set further breakpoints using facilities in
the Script Debugger.
Example VBScript script with a breakpoint:
x = 1
stop ' Execution will stop here the Script Debugger
y = x
Example JScript script with a breakpoint:
x = 1
debugger //Execution will stop
here the Script Debugger
y = x
Back to top
|