Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

Chapter 8 Debugging Visual Basic Programs 223


The Watch window looks like this:

As you can see, both items now contain new values, and this gives you the opportunity
to test the program further.


  1. Click the Step Into button two times to display the Debug Test form again.


Notice that the Text property of the TextBox2 object has been changed, as you directed,
but the Text property of the TextBox1 object still holds a value of 20 (not 17). This is
because you changed the Age variable in the program, not the property that assigned
a value to Age. Your screen looks like the following screen shot:

The Immediate window has many uses—it provides an excellent companion to the Watch
window, and it can help you experiment with specific test cases that might otherwise be very
difficult to enter into your program.

Switching to the Command Window


The text-based Command window offers a complement to the Visual Studio Immediate
window. Reminiscent of the UNIX or MS-DOS command prompt, it can be used to run
interface commands in the Visual Studio IDE. For example, entering the File.SaveAll command
in the Command window saves all the files in the current project. (This command is the
equivalent of the Save All command on the File menu .) If you already have the Immediate
window open, you can switch between the Immediate and the Command windows by
entering the >cmd and immed commands, respectively. You can also click the View menu,
point to Other Windows, and then click Command Window to open the Command window.
You’ll practice using the Command window in the following exercise.
Free download pdf