We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
continue (Read 598 times)
continue
May 6th, 2006, 11:41pm
 
I've just learnt about this command today:

continue

Obviously it's considered standard syntax because it's highlighted. However I've never been taught it or seen it before, and yet I may have thought of using this command but thought it didn't exist. It seems like basic common-sense really that one can force a skip of a loop but I've never known I could.

Should this be added to the Complete Reference or is it better to encourage nesting stuff in blocks to protect them from the rest of the loop
Re: continue
Reply #1 - May 7th, 2006, 11:06am
 
break is also a nice function, but it completly gets you out of a loop

ie:
Code:

for(int i = 0; i < 100; i++){
if(i == 10) continue;
if(i == 20) break;
println(i);
}
Page Index Toggle Pages: 1