Continue

From Microduino Wiki
Jump to: navigation, search
  • continue

Continue statement can skip the rest iterative part( do, for or while )in the current loop. It can check the loop condition expression and continue any subsequent iterations.

  • Example

for (x = 0; x < 255; x ++)
{
    if (x > 40 && x < 120){      // when x is between 40 and 120, skip these two sentences, namely the iterations
        continue;
}
 
    digitalWrite(PWMpin, x);
    delay(50);
}

[Return to Arduino Syntax Manual]