Microsoft KB Archive/33486

= QuickBasic 4.00b UPDATE.DOC: Enhanced ON ERROR Handling =

Article ID: 33486

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q33486



SUMMARY
The following information was taken from the QuickBasic Version 4.00b UPDATE.DOC file. It describes features that have been added since Microsoft QuickBasic Version 4.00 was released.

This information applies to Microsoft QuickBasic Versions 4.00b and 4.50 for MS-DOS, to Microsoft Basic Compiler Versions 6.00 and 6.00b, and and to Microsoft Basic PDS Version 7.00 for MS-DOS and MS OS/2.



MORE INFORMATION
Microsoft QuickBasic Versions 4.00b and later and Basic compiler 6.00b and later include an important new error-handling feature for multiple-module programs.

In previous versions of QuickBasic, an error in a module that did not contain an error handler caused the program to terminate immediately, even if an error handler was present in a different module. QuickBasic 4.00b first looks for an active error handler in the module where the error occurred, then in the module that invoked that module, and so on. QuickBasic follows the chain of procedure invocations back until it finds an active error handler or reaches the program's main module. If QuickBasic cannot find an error handler by this process, the program terminates with an error message.

Note that if the error occurs in an event-handling routine, however, QuickBasic does not search for an error handler beyond the module that invoked the event handler.

This feature affects the behavior of the RESUME statement. In previous versions of QuickBasic, RESUME caused the program to resume execution at the &quot;current statement,&quot; meaning the statement that caused the error. In a QuickBasic 4.00b multiple-module program, however, the &quot;current statement&quot; is the last executed statement in the module containing the active error handler.

The new error-handling feature has a similar effect on the ERL function. In QuickBasic 4.00b, the program line that the ERL function identifies as the source of an error is the line that contains the last executed statement in the module where the active error handler is located.

Additional query words: QuickBas BasicCom B_BasicCom

Keywords: KB33486

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.