O'Reilly logo

Beginning Visual Basic 2015 by Bryan Newsome

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9 Debugging and Error Handling

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • How to correct the major types of errors you may encounter
  • How to debug a program
  • How to implement error handling in a program

WROX.COM CODE DOWNLOADS FOR THIS CHAPTER

The wrox.com code downloads for this chapter are found at www.wrox.com/begvisualbasic2015 on the Download Code tab. The code is in the 311813 c09.zip download and individually named according to the names given throughout the chapter.

Debugging is an essential part of any development project because it helps you find errors both in your code and in your logic. Visual Studio 2015 has a sophisticated debugger built right into the development environment. This debugger is the same for all languages that Visual Studio 2015 supports. When you have mastered debugging in one language, you can debug in any language that you can write in Visual Studio 2015.

No matter how good your code is, there are always going to be some unexpected circumstances that will cause your code to fail. If you do not anticipate and handle errors, your users will see a default error message about an unhandled exception, which is provided by the Common Language Runtime package. This is not a user-friendly message and usually does not clearly inform the user about what is going on or how to correct it.

This is where error handling comes in. Visual Studio 2015 also provides common structured error-handling functions that are used across all languages. These functions enable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required