This section gives you a quick overview of debugging procedures. The process is examined in greater depth in subsequent sections.

The Debugger is always available whenever you run into an error when in Run mode. To open the Debugger and deal with the error on the spot, you need only click the Debug button in the error dialog. When the Debugger opens, you can then proceed from step 2 in the instructions below.

Alternatively, you can run it before running your program, then choose a program to debug. Here’s how:

  1. Start the dBASE Plus Debugger by right clicking on a source file in the Navigator and choosing Debug. The program’s code appears in the Debugger’s Source window, under a tab with the file’s name. If you open multiple programs, each appears under its own labeled tab.

  2. You can then configure a number of options:

If you intend to pause the execution of the program at certain points or isolate a section of the code for test-fix-test cycles, set breakpoints by double-clicking the Stop Hand pointer at the left of the line before which you want a breakpoint.

Open any tool windows you intend to use, for example, to watch variables.

  1. If you set breakpoints, or if any kind of error occurs

The Error Message box displays the dBASE Plus error message. Click OK.

The Debugger’s Source window appears. The offending line immediately precedes the blue-highlighted line.

Check for the more obvious and typical errors: a misspelling or missing punctuation or spaces.

Inspect your public or private variables and expressions by holding the cursor over a variable until a popup dialog box appears with the variable’s current value. This can give you a clue about what went wrong. You can also view all variables in the Variable tool window or set watchpoints for particular expressions and monitor these in the Watch tool window. The debugger, however, won't find the value of a LOCAL variable.

If the form does not appear quite the way you intended when you created it in the Designer, try adjusting some of the display parameters in one of the tool windows. If this works, make the same changes permanently in the code by editing the program in the dBASE Plus Source editor.

For other types of errors, return to the main dBASE Plus Source editor, locate the offending line and make your corrections. Save the file, then restart your program to check the results.

Restart the program to check the results of your correction.

  1. If your application initially appears stable and displays properly, proceed by testing each of its features, entering or editing values, submitting changes to the server, or requesting updates. Click each button and interact with the program in every possible way. Errors generated from these interactions might require you to step into subroutines and again check variable values at each step.

Whenever you need to run the program again from the top, simply switch focus to the Debugger, then switch back to your main program window.