xHarbour Reference Documentation > Function Reference |
Activates and/or invokes the "classic" debugger.
AltD( [<nAction>] ) --> NIL
The return value is always NIL.
Function AltD() toggles the activity of the "classic" debugger which runs in text mode only. To activate the debugger, AltD(1) must be called in a program. A subsequent call to AltD() with no parameter invokes the debugger and displays the PRG source code file with the current line being executed. A programmer can then inspect variables or execute a program step by step. Calling AltD(0) disables the debugger.
When the debugger is activated, the key combination Alt+D invokes the debugger as well. This way, a program can run until a certain situation is reached that must be debugged.
See also: | Set() |
Category: | Debug functions |
Source: | debug\dbgaltd.prg |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates how to invoke the "classic" debugger. // To run the example, create the executable with "classic" debug // information or call xbuild on the command line: // // --> xbuild -B -CLASSIC test.prg PROCEDURE Main LOCAL dDate := Date() LOCAL nKey AltD(1) // activates debugger AltD() // invokes debugger unconditionally ? "Today is:", dDate IF Day( dDate ) == 1 AltD() // invokes debugger conditionally ENDIF nKey := Inkey(0) // debugger is invoked by pressing Alt+D ? "Last key:", nKey RETURN
http://www.xHarbour.com