debugger Statement (JScript 5.6) 

Suspends execution.


debugger

Remarks

You can place debugger statements anywhere in procedures to suspend execution. Using the debugger statement is similar to setting a breakpoint in the code.

The debugger statement suspends execution, but it does not close any files or clear any variables.

Note

The debugger statement has no effect unless the script is being debugged.

Example

This example uses the debugger statement to suspend execution for each iteration through the for loop.

Note

To run this example, you must have a script debugger installed and the script must run in debug mode. For more information, search MSDN (https://msdn.microsoft.com) for the title "Introducing Microsoft Script Debugger".

for(i = 1; i<5; i++) {

   // Print i to the Output window.

   Debug.write("loop index is " + i);

   // Wait for user to resume.

   debugger

}

Requirements

Version 3

See Also

Reference

JScript Statements (JScript 5.6)

Concepts

Conditional Compilation (JScript 5.6)