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.
PLAY Statements (Event Trapping) Details
◄Syntax► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
The PLAY statements (event trapping) enable, disable, and suspend play
event trapping.
PLAY ON
PLAY OFF
PLAY STOP
Usage Notes
■ PLAY ON enables play-event trapping. A play event occurs when the
number of notes in the background-music queue drops below the limit
you set in the ON PLAY statement. If a play event occurs after a
PLAY ON statement, the routine specified in the ON PLAY
statement is executed.
■ PLAY OFF disables play-event trapping so no trapping takes place
until another PLAY ON statement is executed. Events occurring while
trapping is off are ignored.
■ PLAY STOP suspends play-event trapping so no trapping takes place
until a PLAY ON statement is executed. Events occurring while
trapping is suspended are remembered and processed when the next
PLAY ON statement is executed. However, remembered events are
lost if PLAY OFF is executed.
■ When a play-event trap occurs (that is, the GOSUB is performed),
an automatic PLAY STOP is executed so that recursive traps cannot
take place. The RETURN from the trapping routine automatically
executes a PLAY ON statement unless an explicit PLAY OFF was
performed inside the routine.
■ 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."
■ For more information, see Chapter 9, "Event Handling" in the
Programmer's Guide.