EVENT Statements ---------------------------------------------------------------------------- Action Enable or disable trapping of events. Syntax EVENT ON EVENT OFF Remarks EVENT ON enables trapping of events until BASIC encounters the next EVENT OFF statement. EVENT OFF disables trapping of events until BASIC encounters the next EVENT ON statement. The EVENT statements affect compiled code generation. When EVENT OFF is in effect, the compiler will not generate any event-checking code between statements. EVENT OFF is equivalent to compiling a program without -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 subroutine using EVENT ON were called from a section of EVENT OFF code. If an event occurs while EVENT OFF is in effect, this event still is remembered and then is handled as soon as an EVENT ON block is entered. See Also ON event Example See the STRIG statements programming example, which uses the EVENT statements.