TONE is not HALT-able -- causes data loss
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
If you accidentally run a TONE for a very long time,
there is no way to HALT it without killing FMSLogo. As
a result, this should be considered a data loss bug.
The problem is that FMSLogo generates the tone using
Beep(). As mentioned on the MSDN:
The function is synchronous; it performs an
alertable wait and does not return control to
its caller until the sound finishes.
As such, I don't know how much can be done about this bug.
How Reproducible:
Every Time
Steps to Reproduce:
1) TONE 40 30000
2) Click the "Halt" button
What Happens:
FMSLogo plays a tone for 30 seconds. During this time,
FMSLogo is completely unresponsive.
Expected Result:
FMSLogo starts to play a tone, but stops when you press
"Halt".
I have fixed this in [r6043]. Instead of calling Beep, the code now creates a waveform in memory and using wxSound to start and stop it. While the sound is playing, the code checks the message queue for new events (like a Halt). This fix will be available in FMSLogo 8.4.0.
This might have strange side-effects, like continuing the duration if a TONE is interrupted by a long-running instruction.
Related
Commit: [r6043]