CONTINUE statement

The XCSB continue statement is used to immediately skip all statements upto the end of a loop statement.

The following example uses a continue statement to terminate a for loop when x is equal to 15.

x = 0

for j=1 while j<=10 step j=j+1 do

	if x == 15 then
		continue
	endif

	x = x + j

done
It is equivalent to:
x = 0

for j=1 while j<=10 step j=j+1 do

	if x == 15 then
		goto lab_cont
	endif

	x = x + j

lab_cont:

done

The continue statement also has the same effect when used in a while loop.

When the continue statement is used in a loop that is nested inside another loop, the action of the continue statement is to immediately skip all statements upto the end of the innermost loop statement that encompasses it.

e.g.

x = 0

for j=1 while j<=10 step j=j+1 do

	for k=1 while k<=10 step k=k+1 do

		if x == 15 then
			continue
		endif

		x = x + k

	done

	w = w + x

done
This is equivalent to
x = 0

for j=1 while j<=10 step j=j+1 do

	for k=1 while k<=10 step k=k+1 do

		if x == 15 then
			goto lab_001
		endif

		x = x + k

lab_001:

	done

	w = w + x

done