Fuze software crashing, unexpectedly.
-
My program is wrapped inside a conditional loop, and outside that loop I have a menu screen. With it, I have "Press (B) to quit". If (B) is pressed, a boolean condition is set so that the main loop is never executed. When running the program, pressing (B) on the menu screen will crash Fuze and go back to the Nintendo Switch home screen. Seems Fuze is not happy about skipping the main loop.
Condensed Example
menu = true leave = false // menu while menu loop joy = controls(0) // other commands // .... // ... if joy.a then menu = !menu endif if joy.b then leave = !leave menu = !menu endif repeat //main loop while !leave loop // main program code repeat
-
May be related to this: https://fuzearena.com/forum/topic/165/timers-produce-wired-errors-and-also-some-fuze-crashes/2
-
Hi @_JKDOS
I've just tried this same program and I'm not getting a crash.
I tried it exactly as you've written above and also with a
clear()
andupdate()
in themenu
loop. Neither give me a crash.If I could request, could you add me as a friend please and share the program in question. Please let me know the name of the program too.
Friend code: SW-5139-4176-1902 -
@Dave Try this
The "You pressed B" loop isn't needed, but I added it just to show the the program is crashing when it reaches the end of the main sub (Line 34).
-
Just got home dude and I'll be out for a short walk for a little bit but will be trying this later!
-
@Dave Thanks. I'll be heading to the gym after I get off work. So no hurry.
-
It's related to the timer, or should I say, I suspect it's related to the timer. The top one doesn't crash the bottom one does. Comment out the timer from the bottom one and it too doesn't crash.
I thought that perhaps the timer needed to be stopped before exiting the loop but that didn't help.
-
Is there a reason for the SetTimer function to have "-1" set for the counter?
-
@Discostew said in Fuze software crashing, unexpectedly.:
Is there a reason for the SetTimer function to have "-1" set for the counter?
It makes the timer have unlimited repetitions. Extremely useful unless you only want your timer to run a specific number of times. That being said, it being -1 makes no difference in this.
It seems once you set a timer, programs are not allowed to finish without crashing. I'll have to wait for Fuze to patch that.
-
@_JKDOS Unlimited repetitions? I did not know that. Hopefully it isn't just converted to an unsigned number internally (which in this case would be the maximum value of 4,294,967,295 if UINT32), as that would mean in time it would stop.