advr.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.
ON PLAY Statement Details
  Summary  Details  Example                Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
 ON PLAY(queuemin%) 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
 
   ■ The RETURN linenumber or RETURN linelabel forms of RETURN can be used 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."
 
   ■ A play-event trap occurs only when music is playing in the background.
     Play-event traps do not occur when music is playing in the foreground.
 
   ■ A play-event trap does not occur if the background-music queue has
     already gone from having queuemin% notes to (queuemin% - 1) notes
     when a PLAY ON is executed.
 
   ■ If queuemin% is a large number, event traps may occur often enough
     to slow down the program.
 
   ■ The ON PLAY statement specifies only the start of an event-trapping
     routine. The PLAY statement determines whether the routine is called and
     how events are handled when trapping is off. See: PLAY Statement
 
   ■ 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.