This might be a dumb question, but is it possible to ensure that a piece of code gets run on program exit when a user presses start?
Actually, when you turn off SYSBEEP, please return it to the state it was in before. Otherwise, it'd be really annoying.
EDIT: This post made more sense when the OP was "When you turn off SYSBEEP, please turn it on again ...".
When does this matter?
If I'm making a game where there is no keyboard input at all, but there's a lot of loading files, then I would want to keep SYSBEEP off. I'm the developer, and if my program/game doesn't benefit from having it on then why should I turn it on?
Same goes for font and BGM. As long as these things don't interfere during normal use of the program or game, then the dev shouldn't have to worry about it.
If you're doing weird things with other people's code, or you're modifying it or learning how it works, and this kind of stuff bothers you, you should just take care of it on your end and save it for your own personal future use/reference. It's actually a bit rude to ask every single other developer to adhere to one obscure and arguably problematic practice just to save yourself a minor effort when you use the same code for anything other than executing it.
Am I missing something? Do these settings stick after you return to the main menu?
They do not stick around when you return to the main menu. They do stick around when you return to Direct Mode.
I think it's just keyboard sounds and warning sounds (an error will beep once).
As I always return to the main menu before I run someone else's program, I felt no need to clean up for something this minor in my opinion (and I didn't for my Ogiri entry).
If it's only a matter of adding "SYSBEEP = 1" at the end, I might do it. But the VAR and IF...THEN method just confuses me and sorry, I honestly don't care. I suggest resetting everything by returning to the main menu.
it's as simple as this
VAR SBOLD%=SYSBEEP at your program's init routine, and SYSBEEP=SBOLD% at your program's exit routine. This puts SYSBEEP at whatever state it was before the user started the program, assuming the user exits properly (without using START or a crash).
Ugh! I thought it was only the load sound that bothered me so I removed SYSBEEP=0 and just set LOAD FALSE in my Ogiri program and publicly released it, but now I'm in deep regrets - it beeps every time a dialog pops up!
I should have just kept what I did - turn off SYSBEEP and not turn it back on/return state. I just don't... I'm sorry, care. I need that beep OFF at all times, it's ruining my game :(
Maybe I'll reupload it (either put SYSBEEP=0 at the beginning and SYSBEEP=1 at the end, or nothing at the end) and change my key. I wanted to use post #13's method, but #14 seems to be telling me there's a problem with that code. #15 looks too pro to a beginner like me, #7-#16-#17 looks contradicting... I just don't know what to believe anymore.
#stopyourstupidrantlohad
I hate typing with SYSBEEP off.