continue stops executing the loop for that 1 iteration and goes to the next one.
Also,
continue can be used in all types of loops.
Example:
Code:
for(new i = 0; i < 4; i++)
{
if(i == 1) continue;
server_print("%d", i);
}
This would be the process:
Code:
create and initialize i to 0
0 < 4 so do loop
0 is not 1, so go past this
print 0
0++ = 1
1 < 4 so do loop
1 is 1, so do not go past this
1++ = 2
2 < 4 so do loop
2 is not 1, so go past this
print 2
2++ = 3
3 < 4 so do loop
3 is not 1, so go past this
print 3
3++ = 4
4 is not < 4 so exit loop
Print output:
__________________