4.11 Stepping Through Code

Stepping allows you to examine changes in variable values or determine if the program flow is correct. Available step functions are shown in the table below.

Step Over – Executes one source line of a program. If the line is a function call, it executes the entire function and stops.
Step Into – Executes one source line of a program. If the line is a function call, it executes the program up to the function’s first statement and stops.
Step Out – Executes one source line of a program. If the line is a function call, it executes the functions and returns control to the caller.
Run to Cursor – Runs the current project to the cursor’s location in the file and stops program execution.

Use Step Over or Step Into to execute the code on the breakpoint line. As the break stopped the counter at 1, the condition executes as false and control will return to and halt at the previous while statement (see figure below).

Figure 4-13. Code During Step