Stepping into

Step Into executes code one statement (or instruction) at a time. If the statement being executed calls another procedure, stepping into that statement simply transfers control to the first line in the called procedure. For instance, with reference to the previous code, stepping into the line:

Call ProcedureB

in ProcedureA transfers control to the first line of ProcedureB : ActiveSheet.Cells(1, 1).Font.Size = 24

Further tracing proceeds in ProcedureB. Once all of the lines of ProcedureB have been traced, control returns to ProcedureA at the line immediately following the call to ProcedureB—that is, at the line:

ActiveSheet.Cells(1, 1).Font.Bold = True

Step Into has another important use. If we choose Step Into while still in design mode, that is, before any code is running, execution begins but break mode is entered before the first line of code is actually executed. This is the proper way to begin tracing a program.

0 0

Post a comment