Selecting Run from the debug menu (or clicking the Run button on the toolbar) will run the current project. When you run a program from the Studio it is running transparently in the Studio Debugger.
Under the Studio's Debugger, your program is either running normally (executing), or in break mode. Break Mode is when execution has been paused, or the execution has stopped on a breakpoint. Most debugging functionality, such as viewing the current value of variables, is possible only when the program is in break mode.
The most common approach to debugging will be to:
You set breakpoints directly in the Code Editor by finding the source code location where to place the breakpoint, and clicking in the left margin of the editor. You can also right-click and select Breakpoint Set/Remove, or press F9. The Breakpoints Panel also lets you manage existing breakpoints.
When a breakpoint is encountered, the DataFlex program is paused and the current instruction source module and line is displayed. You are now in debug break mode - the Studio controls the execution of the program. This is where the debugging process really begins.
Once the program is paused, you can inspect the state of your program. You can for example:
At all times you can view source code from any module within your program.
While in debug mode, you have several options available for controlling program execution. You can:
During this stepping process you will continue to inspect the state of your local variables and other data. The heart of debugging is controlling execution and stepping through a program while local variables and other values are inspected.
For more information on this topic, please refer to Execution Control.
You can debug Web applications/Web Services as well as Windows applications in the Studio. When debugging a web application, the Studio runs the program and also launches a web browser window so you can control the web application program being debugged.
When debugging web applications, you can place breakpoints and inspect variables etc. as usual in your DataFlex program and source code.
When you are running your program in the Debugger and an unhandled error occurs, the error message will contain a dump of the message stack and a "Debug" button. Clicking the Debug button will break program execution and position the cursor at the line of code that raised the error.
This is a useful technique for quickly tracking down the cause of unhandled errors in your program.