Cannot Nest ON ERROR GOTO Error-Trapping Routines in Basic (39860)
The information in this article applies to:
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
This article was previously published under Q39860 SUMMARY
After control is passed to an error handler in a Microsoft QuickBasic
program, additional errors cannot be trapped until a RESUME, RESUME
label, or RESUME NEXT occurs. Errors that occur within the error
handler itself will stop the program. This behavior is by design and
applies to Microsoft QuickBasic versions 2.0, 2.01, 3.0, 4.0, 4.0b, and
4.5, and to Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS
and MS OS/2. (If Basic did not have this design feature, an error
occurring within the error handler would cause a recursive loop which
would quickly use up all stack space and stop the program.)
This information also applies to Microsoft Basic Professional
Development System (PDS) versions 7.0 and 7.1 for MS-DOS and MS OS/2
when using global or "module level" error trapping. However, note that
you may use a global (module level) error handler to trap an error
that occurs inside a local error handler invoked with an ON LOCAL
ERROR statement (a feature available in Microsoft Basic PDS versions
7.0 and 7.1). Thus you can trap errors that occur within ON LOCAL
ERROR handlers in Basic PDS.
Modification Type: | Major | Last Reviewed: | 10/20/2003 |
---|
Keywords: | KB39860 |
---|
|