Failure to Trap Event Compiled BC /w; Needs Line Label or /v (45948)
The information in this article applies to:
- Microsoft QuickBASIC 1.0
- Microsoft QuickBASIC 1.01
- Microsoft QuickBASIC 1.02
- Microsoft QuickBASIC 2.0
- Microsoft QuickBASIC 2.01
- Microsoft QuickBASIC 3.0
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
This article was previously published under Q45948 SUMMARY
The /w compiler option produces smaller EXE files, but event checking
is done much less frequently than if /v is used.
In programs without line labels or line numbers, event trapping
requires the /v (check between statements) compiler option. In
programs compiled with the /v option, events are checked before every
statement.
If your program is compiled with the /w option, events are checked
only when a labeled or numbered line is encountered at run time. As a
result, if compiled with the /w switch, your program will never trap
an event if it doesn't pass through a statement that has a label or
line number.
This information applies to all ON Event GOSUB statements [where Event
can be COM(n), KEY(n), PEN, PLAY(n), STRIG(n), or TIMER(n)] for event
trapping in Microsoft QuickBasic Versions 1.00, 1.01, 1.02, 2.00,
2.01, 3.00, 4.00, 4.00b, and 4.50 for MS-DOS; Microsoft Basic Compiler
Versions 6.00 and 6.00b for MS-DOS and MS OS/2; and Microsoft Basic
PDS Version 7.00 for MS-DOS and MS OS/2. In QuickBasic 4.00b and
later, Basic compiler 6.00 and 6.00b, and Basic PDS 7.00, the ON
UEVENT GOSUB and CALL SetUEvent statements were added for user-defined
event trapping.
Modification Type: | Minor | Last Reviewed: | 1/9/2003 |
---|
Keywords: | KB45948 |
---|
|