The Script Debugger

Using the Microsoft Script Debugger, shown in Figure 6-2, you can debug the VBScript you add to an Outlook application. You also use this debugger for Microsoft Active Server Pages, so learn to use it—it will assist you as you develop all your Exchange Server applications.

click to view at full size.

Figure 6-2 The Microsoft Script Debugger.

To use the Script Debugger, you must first install it. The Script Debugger is part of the Development Tools component in Outlook. You can add this component by running Add/Remove Programs for Outlook 98.

The Script Debugger can be launched in two ways. The first way is by inserting a Stop statement in your VBScript. When you run your form and the Stop statement is executed, the Script Debugger should automatically be launched. The second way is to launch it manually from a form that contains VBScript and is in run mode by choosing Tools/Forms and then Script Debugger.

The following list describes some of the common tasks you will want to perform with the Script Debugger:

  • Set a breakpoint.To set a breakpoint, insert a Stop statement in your VBScript code. When this Stop statement is encountered, the Script Debugger should be automatically launched.
  • Control script execution.Once in the Script Debugger, you can control the execution of the script. You can either step through a procedure line by line or step over procedures. You can also cause the script to continue executing normally after it has been stopped.
  • View and change values at run time.Through the Command window of the Script Debugger, you can view and change the values for specific variables in your application. These changes are preserved only in the context of the current script. For example, you can print out to the Command window the value of a variable, such as the Subject property of the current item, by using the command ? Item.Subject. You can also change the value by typing in an assignment statement such as Item.Subject = "My Debugged Script". You can execute methods inside of your script by calling them directly.
  • Trace the call stack.The Script Debugger includes all the currently running procedures in your script. This allows you to see how a particular procedure was called, which is especially helpful when that procedure is a part of a nested procedure. (Note that you can view the source of your script in the Script Debugger, but it's read-only. To make changes to your script, you need to go back to the Outlook Script Editor.)


Programming Microsoft Outlook and Microsoft Exchange
Programming Microsoft Outlook and Microsoft Exchange, Second Edition (DV-MPS Programming)
ISBN: 0735610193
EAN: 2147483647
Year: 1999
Pages: 101

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net