Switch-Case and Continue

Discuss any general programming issues here
Post Reply
Flinx
Posts: 188
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Switch-Case and Continue

Post 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
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Switch-Case and Continue

Post by airsoftsoftwair »

Flinx wrote: Thu Aug 26, 2021 1:11 pm Is this the intended behaviour?
Definitely not! Will fix this, thanks for reporting!
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Switch-Case and Continue

Post 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
Post Reply