Page 1 of 1

Switch-Case and Continue

Posted: Thu Aug 26, 2021 1:11 pm
by Flinx
Hello,

I have a Switch-Case statement inside of a Repeat loop. If I try to force the loop with the Continue statement after a Case statement the program freezes. With a level 2 argument the Continue works as I would have expected.
Here is an example with a While loop:

Code: Select all

a=0
While a<3
	a=a+1
	DebugPrint("\n",a)
	Switch a
	Case 1:
		DebugPrint("Case 1")
	Case 2:
		DebugPrint("Case 2")
		;Continue(2) ; works
		Continue ; freezes
	EndSwitch
	DebugPrint("after Switch",a)
Wend
Is this the intended behaviour?

Ralf

Re: Switch-Case and Continue

Posted: Thu Aug 26, 2021 9:08 pm
by airsoftsoftwair
Flinx wrote: Thu Aug 26, 2021 1:11 pm Is this the intended behaviour?
Definitely not! Will fix this, thanks for reporting!

Re: Switch-Case and Continue

Posted: Sat Oct 30, 2021 11:52 pm
by airsoftsoftwair
Fixed now. You've already found the workaround, just use Continue(2) and it will work.

Code: Select all

- Fix: "Continue" didn't work correctly inside the Switch-Case statement