Running is a basic operation that is used to test user code of a form or a unit or their .NET analogs.
Two modes of object running are available in the development environment:
Run without debugging.
Run with debugging.
Code syntax is checked at object startup. If there are any errors or mismatches, corresponding compiler message is generated.
Running without debugging is used to quickly check application functionality without debugging individual code blocks. In this case the object is run within the current application, and performance speed corresponds to work in industrial environments.
To run an object opened in the development environment without debugging, execute one of the operations:
Select the Debug > Run without Debugging main menu item.
Press CTRL+SHIFT+F9.
On checking object work without debugging mode, it is available to display debug information to development environment console. To display information the platform uses static properties and methods of the Debug class.
If an exception is thrown at the runtime, the error occurs at the platform level and an information message is displayed. The user can work with the running object after closing the error message.
Running with debugging is used to check performance of individual code blocks. Objects are run for debugging in an individual process that is why it is more time-consuming than running without debugging. Determine breakpoints for code debugging. Breakpoint indicates that the debugger must stop code execution at some point. To set a breakpoint, place the cursor to the required code line, and press F5, or click next to the required line in the Tabs and Breakpoints area (gray area to the left of macro window). A breakpoint is marked with a red round point. Right-click on the marker to open the Breakpoint Parameters dialog box.
To run an object opened in the development environment with debugging, execute one of the following operations:
Select the Debug > Run main menu item.
Press F9.
Click the
button on the Debug toolbar.
Select the Run context menu item of the corresponding object in the project navigator.
On reaching a breakpoint code execution is paused and the currently executed line is highlighted in green. Object execution switches to debug mode. Debug mode gives access to various development environment tools that enable the user to check code performance:
To control the code progress in the debug mode, use the following commands:
- Step over. Executes the current line stepping over nested custom methods.
- Run. While executing the current line, steps in nested custom methods and executes them step by step.
- Run until Return. Executes code until it returns to the breakpoint.
These commands are available in the Debug main menu and also on the Debug toolbar. The main menu also has the Debug > Run to Cursor item that enables the user to continue code execution until the line with the cursor.
NOTE. If the Pause Execution on Exception checkbox is selected in development environment settings, then if there are any errors, the object will be opened in debug mode with focus on the row with error.
Advanced features of running various development environment objects are described in the following subsections:
See also: