Set debug mode

Syntax

deb[-] [speed]

 

Parts

speed - number of milliseconds to wait before executing a statement. Default: -1 (infinite).

Options: - stop debug mode.

 

Remarks

Sets debug mode for current macro. It is similar to inserting a breakpoint in other development environments. When macro runs in debug mode, executed statements are highlighted.

 

If speed is omitted or -1, each statement is highlighted and macro waits until you click one of the following Run menu items or Debug Toolbar buttons:

 

Next - execute the current (highlighted) statement and stop at the next statement.

 

Run To Cursor - execute following statements and stop at the statement that contains the text cursor.

 

Continue - execute following statements until the next deb or until the end of macro.

 

End - end debugged macro(s).

 

If speed is >= 0, each statement is highlighted for minimum speed milliseconds, and then macro continues automatically.

 

Debug mode is applied to whole thread. That is, user-defined functions that are called also run in debug mode. Debug mode is not applied to macros and functions that are in nonexpanded folders, or if QM window is hidden.

 

While macro is stopped, it is not completely blocked. It allows to process dialog messages, COM events, etc. Debug mode is not applied to the code that is executed while macro is stopped, even if the code calls deb.

 

Tips

Instead of deb, you can use the Deb function, which starts debug mode and shows the Debug Toolbar.

You can place deb in several places in macro. It allows you to execute parts of macro in different speeds, or temporarily turn off the debug mode.

If you want to debug only certain message in dialog box procedure, don't forget to place deb- when leaving the code.

 

See also: other commands.

 

Examples

Deb ;;show the Debug Toolbar and set manual debug mode
 ...
deb 500 ;;run automatically and highlight each statement for minimum 500 ms
 ...
deb 0 ;;run in normal speed, and highlight statements only while they are executed 
 ...
deb- ;;deactivate the debug mode (run normally)
 ...