Microsoft KB Archive/32272

= All Event Handling Is Disabled in an ON ERROR GOTO Handler =

Article ID: 32272

Article Last Modified on 8/16/2005

-

APPLIES TO


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

-



This article was previously published under Q32272



SUMMARY
All event handling is suspended in an ON ERROR GOTO handler. The following types of events are suspended during an error trapping routine:


 * 1) Key trapping (ON KEY(n) GOSUB)
 * 2) Timer (ON TIMER(n) GOSUB)
 * 3) Communications (ON COM(n) GOSUB)
 * 4) Light Pen (ON PEN GOSUB)
 * 5) Joy Stick (ON STICK GOSUB)
 * 6) User-defined event (ON UEVENT GOSUB)

These events are enabled again as soon as the error trap is exited with a RESUME or RESUME NEXT statement.



MORE INFORMATION
The following code sample demonstrates this type of behavior: ON ERROR GOTO trap ON KEY(1) GOSUB keytrap KEY (1) ON  ERROR 5    ' Forces an error 5. END

trap:

PRINT &quot;In the error trap, enter F1&quot; while inkey$=&quot;&quot; wend RESUME NEXT

keytrap:

Print &quot;A key as pressed&quot; return

Additional query words: VBmsdos QuickBas BasicCom

Keywords: KB32272

-

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

© Microsoft Corporation. All rights reserved.