All Event Handling Is Disabled in an ON ERROR GOTO Handler
ID: Q32272
|
The information in this article applies to:
-
Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
-
Microsoft QuickBASIC for MS-DOS, versions 2.0, 2.01, 3.0, 4.0, 4.0b, 4.5
-
Microsoft BASIC Compiler for MS-DOS and MS OS/2, versions 6.0, 6.0b
-
Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2, version 7.0
SUMMARY
All event handling is suspended in an ON ERROR GOTO handler. The
following types of events are suspended during an error trapping
routine:
- Key trapping (ON KEY(n) GOSUB)
- Timer (ON TIMER(n) GOSUB)
- Communications (ON COM(n) GOSUB)
- Light Pen (ON PEN GOSUB)
- Joy Stick (ON STICK GOSUB)
- 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 "In the error trap, enter F1"
while inkey$=""
wend
RESUME NEXT
keytrap:
Print "A key as pressed"
return
Additional query words:
VBmsdos QuickBas BasicCom
Keywords :
Version : MS-DOS:1.0,2.0,2.01,3.0,4.0,4.0b,4.5; :6.0,6.0b,7.0
Platform : MS-DOS
Issue type :