When SOUND is used repeatedly with short durations, it seems that
repeated keyboard input crashes the program.
I tested the following code while keeping a key pressed continually
from the beginning of program execution:
Result: Nothing gets printed, and the program freezes (although in
the IDE I can still exit with Ctrl+Break). Sometimes the "OK" gets
printed, but afterwards the program freezes. (This happens only if
SOUND is in a loop, but not with several single SOUND statements
of longer duration.)
- I tried then to empty the keyboard buffer continually by putting
an INKEY$ insinde the loop:
But the result was exactly the same as in the first example.
Does anybody know what is happening, and if there is a way to
avoid this problem?
Hans Ruegg
repeated keyboard input crashes the program.
I tested the following code while keeping a key pressed continually
from the beginning of program execution:
Code:
SOUND 512, 20 FOR i = 1 TO 40 SOUND 1024, 0.5 NEXT i PRINT "OK" FOR i = 1 TO 40 SOUND 256, 0.5 NEXT i SOUND 512, 20 PRINT "ENDED" END
the IDE I can still exit with Ctrl+Break). Sometimes the "OK" gets
printed, but afterwards the program freezes. (This happens only if
SOUND is in a loop, but not with several single SOUND statements
of longer duration.)
- I tried then to empty the keyboard buffer continually by putting
an INKEY$ insinde the loop:
Code:
SOUND 512, 20 FOR i = 1 TO 40 SOUND 1024, 0.5: m$=INKEY$ NEXT i PRINT "OK" FOR i = 1 TO 40 SOUND 256, 0.5: m$=INKEY$ NEXT i SOUND 512, 20 PRINT "ENDED" END
Does anybody know what is happening, and if there is a way to
avoid this problem?
Hans Ruegg
Comment