bas7advr.hlp (
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
EVENT Statements Details
◄Syntax► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
The EVENT statements enable or disable trapping of events.
EVENT ON
EVENT OFF
Usage Notes
■ The EVENT statements affect compiled code generation. When EVENT OFF
is in effect, the compiler will not generate any event-checking code.
■ EVENT OFF is equivalent to compiling a program from the BC command
line without using /V or /W. EVENT OFF can be used to create small
and fast code that still supports event trapping.
■ If your program contains event-handling statements and you are
compiling from the BC command line, use the BC /W or /V option.
(The /W option checks for events at every label or line number; the
/V option checks at every statement.) If you do not use these
options and your program contains event traps, BASIC generates the
error message, "ON event without /V or /W on command line."
■ EVENT OFF and EVENT ON can be used to bracket sections of code
where events do not need to be detected and trapped, and fast
performance is required. Events still could be detected and tracked
if a routine using EVENT ON were called from a section of EVENT OFF
code.
■ If an event occurs while EVENT OFF is in effect, this event is still
remembered and then is handled as soon as an EVENT ON block is
entered.