Microsoft Visual Basic 2005 Step by Step (Step by Step (Microsoft))

Chapter 8

Debugging Visual Basic Programs

After completing this chapter, you will be able to:

In the past few chapters, you've had plenty of opportunity to make programming mistakes in your code. Unlike human conversation, which usually works well despite occasional grammatical mistakes and mispronunciations, communication between a software developer and the Microsoft Visual Basic compiler is successful only when the precise rules and regulations of the Visual Basic programming language are followed.

In this chapter, you'll learn more about the software defects, or bugs, that stop Visual Basic programs from running. You'll learn about the different types of errors that turn up in programs and how to use the Visual Studio debugging tools to detect and correct these defects. What you learn will be useful as you experiment with the programs in this book and when you write longer programs in the future.

Why focus on debugging now? Some programming books skip this topic altogether or place it near the end of the book (after you've learned all the language features of a particular product). There is a certain logic to postponing the discussion, but I think it makes the most sense to master debugging techniques while you learn to program so that detecting and correcting errors becomes part of your standard approach to writing programs and solving problems. At this point in Microsoft Visual Basic 2005 Step by Step, you know just enough about objects, decision structures, and statement syntax to create interesting programs but also enough to get yourself into a little bit of trouble! As you'll soon see, however, Microsoft Visual Studio 2005 makes it easy to uncover your mistakes and get back on the straight and narrow.

Upgrade Notes: Migrating Visual Basic 6 Code to Visual Basic 2005

If you're experienced with Microsoft Visual Basic 6, you'll notice some new features in Microsoft Visual Basic 2005, including the following:

Категории