Break mode pauses the execution of any code, and allows you to edit it. In break mode properties and values are held so that you can analyes thier current state. Break mode can be reached by either:
1) Selecting Break from the Run menu (Ctrl+Break) or pressing the button (Pause Button)
2) Visual Basic reaching a Stop statement in your code.
3) Visual Basic reaching a Break Point
When debugging you might want the code to halt at a problem statement where you think the problem may have started. Visual Basic provides breakpoints and Stop statements for this. Breakpoints pauses Visual Basic, the cursor is moved to the break point and is highlighted in yellow. You can then check values of variables, use the immediate pane (see below) and edit code. The same thing occurs if Visual Basic reaches the Stop statement. To create a breakpoint, simply left-click in the light grey area to the left of your code, or press the button. The current line of code will then be highlighted in red, and made bold. To remove the break point simply do click in the grey area again, or press the breakpoint button.
To check the value of a variable or constant, you can use some of the methods described in the next few sections. You can also just leave the mouse cursor over the variable or constant and after a few seconds a tooltip will appear giving the value:
Tooltip
To continue code execution, simply press the Play button, or press F5.
Comments