I am trying to convert a game and came across the command "continue" in several places.
Within a "do" loop... if not active() then continue
and
Within a For "loop"... if pieces[p][i].finished then continue
Would I be correct in assuming that this is used similar to "break"?
(04-11-2026, 07:39 AM)johnno56 Wrote: [ -> ]I am trying to convert a game and came across the command "continue" in several places.
...
As far as I know :
If you were looping through numbers 1 to 5
Using break at 3: The output would be 1, 2. The loop stops dead at 3.
Using continue at 3: The output would be 1, 2, 4, 5. Only the number 3 is skipped.
(04-11-2026, 07:39 AM)johnno56 Wrote: [ -> ]I am trying to convert a game and came across the command "continue" in several places.
Within a "do" loop... if not active() then continue
and
Within a For "loop"... if pieces[p][i].finished then continue
Would I be correct in assuming that this is used similar to "break"?
Micha is right. In the languages that I've used, "continue" skips the rest of the code within the loop and jumps to the top of the loop.
Code:
FOR i = 1 TO 5
IF i = 3 THEN CONTINUE
PRINT i
NEXT
would give the output:
There is no continue in naalaa though. But I'll make a note and see if I can add it in the next version! It's one of these commands that I, for some reason, never actually use in any language

Ok. Thanks for clearing that up. Much appreciated. I'll just put 'continue' in the same pigeon-hole as 'goto' and move onto another project. Thank you for the offer to add it to the next release, but seeing it is so rarely used, if it were up to me, I probably would not waste the time... lol
(04-11-2026, 01:35 PM)johnno56 Wrote: [ -> ]Ok. Thanks for clearing that up. Much appreciated. I'll just put 'continue' in the same pigeon-hole as 'goto' and move onto another project. Thank you for the offer to add it to the next release, but seeing it is so rarely used, if it were up to me, I probably would not waste the time... lol
But it's one of those commands that are quite easy to work around, I think. You can usually use a simple if-statement for the same thing. But I shall add it

(04-11-2026, 01:35 PM)johnno56 Wrote: [ -> ]Ok. Thanks for clearing that up. Much appreciated. I'll just put 'continue' in the same pigeon-hole ..
Instead of boxing it in, you can still just use the 'continue' command like this in Naalaa
Code:
'-----
'MAIN
'-----
visible i
for i = 1 to 5
if i = 3 then continue()
pln i
next
system("pause")
'----------
'FUNCTIONS
'----------
function continue()
i = i + 1
endfunc
Cool... I will give that a go... Thank you.