advr.hlp (Topic list)
UEVENT Statement Details
  Summary  Details  Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
 UEVENT {ON | OFF | STOP}
 
 Usage Notes
   ■ The UEVENT statement does not affect form- or control-specific
     events. Forms and controls use different event handlers. Use object-
     specific events with forms. See: Object Events Summary
 
   ■ If your program contains event-handling statements and you are compiling
     from the BC command line, use the /W or /V option. If you do not use
     these options and your program contains event traps, Visual Basic
     generates the error message, "ON event without /V or /W on command
     line." See: BC Command-Line Options
 
   ■ UEVENT ON enables trapping of a user-defined event. A user-defined
     event is usually a hardware interrupt (although it can be a software
     interrupt). If a user-defined event occurs after a UEVENT ON statement,
     the routine specified in the ON UEVENT statement is executed.
 
   ■ UEVENT OFF disables trapping of a user-defined event. No trapping takes
     place until another UEVENT ON statement is executed. Events occurring
     while trapping is off are ignored.
 
   ■ UEVENT STOP suspends trapping of a user-defined event. No trapping takes
     place until a UEVENT ON statement is executed. Any defined user events
     that occur while trapping is suspended are remembered and processed when
     the next UEVENT ON statement is executed. However, remembered events are
     lost if a UEVENT OFF statement is executed before a UEVENT ON statement
     is encountered.
 
   ■ When a user-defined trap occurs (that is, the GOSUB is performed), an
     automatic UEVENT STOP is executed so that recursive traps cannot take
     place. The RETURN from a trapping routine automatically executes a
     UEVENT ON statement unless an explicit UEVENT OFF was performed inside
     the routine.