B4J Question Keyword Continue explaination

Mikelgiles

Active Member
Licensed User
Longtime User
Where would I find a good explanation of what the Keyword Continue does? I find it used mostly in a for next loop but not always. I guess mu problem is that I am not totally sure what a iteration is.
 

stevel05

Expert
Licensed User
Longtime User
B4X:
For i = 0 to 10
    if i < 5 Then Continue
    Log(i)
Next

Simple example, each time the loop goes round is an iteration. The continue keyword stops the current iteration and starts the next. So in this case i will be incremented and the code will continue from the start of the loop.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…