10-23-2022, 11:48 PM
As Pete demonstrated, there are often quicker and more concise ways to skip a loop iteration. I use it fairly often, but it's hard to justify, except in rare circumstances. I agree, it's a style thing. It can make code a little harder to read for debugging too, since there's fewer indentation blocks over using an IF ... END IF block.
I like _CONTINUE for things like the following:
active% = 5
FOR x% = 1 to 10
IF x% = active% THEN _CONTINUE
'code to determine distance between objects x% and active%
NEXT x%
It tightens the line count (but not the typing) slightly from:
active% = 5
FOR x% = 1 to 10
IF x% <> active% THEN
'code to determine distance between objects x% and active%
END IF
NEXT x%
I like _CONTINUE for things like the following:
active% = 5
FOR x% = 1 to 10
IF x% = active% THEN _CONTINUE
'code to determine distance between objects x% and active%
NEXT x%
It tightens the line count (but not the typing) slightly from:
active% = 5
FOR x% = 1 to 10
IF x% <> active% THEN
'code to determine distance between objects x% and active%
END IF
NEXT x%
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
sha_na_na_na_na_na_na_na_na_na: