NAME
PLAY, ON PLAY Statements (Event Trapping)
SYNOPSIS
PLAY ON
PLAY OFF
PLAY STOP
ON PLAY(queuelimit%) GOSUB line
o PLAY ON Enables play event trapping.
o PLAY OFF Disables play event trapping.
o PLAY STOP Suspends play event trapping. Events are processed once
event trapping is enabled by PLAY ON.
o queuelimit% A number in the range 1 through 32. ON PLAY branches to
a subroutine when there are fewer than queuelimit%
notes in the music buffer.
o line The label or number of the first line of the
event-trapping subroutine.
DESCRIPTION
PLAY enables, disables, or suspends play event trapping.
If event trapping is enabled, ON PLAY branches to a subroutine whenever
the music buffer contains fewer than a specified number of notes.
Example:
ON PLAY(3) GOSUB Background
PLAY ON
Music$ = "MBo3L8ED+ED+Eo2Bo3DCL2o2A"
PLAY Music$
LOCATE 2, 1: PRINT "Press any key to stop.";
DO WHILE INKEY$ = "": LOOP
END
Background:
i% = i% + 1
LOCATE 1, 1: PRINT "Background called "; i%; "time(s)";
PLAY Music$
RETURN
SEE ALSO
PLAY (Music) PLAY