Datasheet

50
CHAPTER 1 VISUAL STUDIO 2010
of code is in the Get method of the parameter. Once there, you may want to step out. Stepping out of a
method tells the debugger to execute the code in the current method and return you to the line that called
the method. Thus, you could step out of the property and then step in again to get into the method you are
actually interested in debugging.
Of course, sometimes you don t want to step into a method; this is where the Step - Over button comes in. It
enables you to call whatever method(s) are on the current line and step to the next sequential line of code in
the method you are currently debugging. The fi nal button, Step - Out, is useful if you know what the code in a
method is going to do, but you want to determine which code called the current method. Stepping out takes
you directly to the calling code block.
Each of the buttons shown on the debugging toolbar in Figure 1 - 31 has an accompanying shortcut key for
experienced developers who want to move quickly through a series of breakpoints.
Of course, the ability to leverage breakpoints goes beyond what you can do with them at runtime. You can
also disable breakpoints that you don t currently want to stop your application fl ow, and you can move a
breakpoint, although it s usually easier to just click and delete the current location, and then click and create
a new breakpoint at the new location.
Keeping in mind that Visual Basic 2010 Express Edition does not support the advanced properties of
breakpoints, Visual Studio provides additional properties for managing and customizing breakpoints. As
shown in Figure 1 - 32, it s also possible to add speci c properties to your breakpoints. The context menu
shows several possible options.
FIGURE 1 - 32
More important, it s possible to specify that a given breakpoint should execute only if a certain value is defi ned
(or undefi ned). In other words, you can make a given breakpoint conditional, and a pop - up window enables
you to defi ne this condition. Similarly, if you ve ever wanted to stop, for example, on the thirty - seventh iteration
of a loop, then you know the pain of repeatedly stopping at a breakpoint inside a loop. Visual Studio enables
you to specify that a given breakpoint should only stop your application after a specifi ed number of hits.
CH001.indd 50CH001.indd 50 4/5/10 11:57:00 AM4/5/10 11:57:00 AM