You are here: AxTools > CodeSMART 2007 for VB6 > Documentation > User's Guide > Error Handling > Exception Handling Basics
While browsing this page, why not start downloading the evaluation setup kit (direct download, no questions asked).

Exception Handling Basics

The exception is an event that occurs during the execution of a program and it requires the execution of code outside the normal flow of control. There are two kinds of exceptions:

1. Hardware exceptions that are initiated by the CPU. They can result from the execution of certain instruction sequences (e.g. division by zero or an attempt to access an invalid memory address).

2. Software exceptions that are initiated explicitly by applications or by the operating system. (e.g. the system can detect when an invalid parameter value is specified).

Because Visual Basic doesn't offer built-in support for handling anomalous situations, you should use the MExceptionHandler module (or anything similar) that implements code for filtering any unhandled exceptions that may occur during a program's execution. In this way your program can communicate unexpected events to a higher execution context that is able to recover from such abnormal events. Also, handling exceptions ensures that a termination code containing clean-up tasks is executed even if an exception or some other error occurs while the code is being executed.

See also
Error Handling Overview
Error Handling Schemes And Assignments
Error Handling Scheme Modifiers
Inserting and Removing Error Handlers
Inserting and Removing Line Numbers
Inserting and Removing Line Numbers from Command Line
Adding and Removing the Exception Handling Module

Back To Top

Copyright © 2008 AxTools - CodeSMART 2007 for VB6 - Error Handling