advr.hlp (Topic list)
ON COM Statement Details
  Summary  Details  Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
 ON COM(n%) GOSUB {linenumber | linelabel}
 
 Usage Notes
   ■ 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
 
   ■ Use RETURN linenumber or RETURN linelabel forms of RETURN to return to
     a specific line from a trapping routine. However, any GOSUB, WHILE, or
     FOR statements active at the time of the trap remain active. Visual
     Basic may generate error messages such as "NEXT without FOR." In
     addition, if an event occurs in a procedure, a RETURN linenumber or
     RETURN linelabel statement cannot get back into the procedure, because
     the line number or label must be in the module-level code.
 
   ■ If your program receives data using an asynchronous communications
     adapter, use the Visual Basic (VBDOS) command-line option /C to set
     the size of the data buffer. See: VBDOS Command-Line Options
 
   ■ The ON COM statement specifies only the start of an event-trapping
     routine. The COM statement determines whether the routine is called and
     how events are handled when trapping is off. See: COM Statement