Freetutes.com

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > Advanced VB6 tutorial > Chapter 11

Sponsored Links

Handling Errors in Code

 
There are several ways to handle errors in your Visual Basic applications. The simplest but least effective way is not to do anything. Let the errors occur. Windows will generate error messages to the user, and the application will shut down. A better way to handle errors is to trap the errors with the Visual Basic statement On Error. By coding On Error, you are handling errors in a more graceful manner.

You have the option of trying to correct the problem through code, to bypass the code that caused the error, or to shut down the application if the error is unrecoverable.

This section discusses the On Error statement and the different ways of using it in procedures. The discussion examines inline error handling and error-handling routines found at the end of procedures. Some trappable errors will also be covered with recommendations on how to use them and what to look for in code.

<< Previous | Contents | Next >>

 

Home | Link to Us | Partner Links | About Us | Contact Us
Copyright © 2007-2008 Freetutes.com | All Rights Reserved