API Reference › Control flow › continue
keyword

continue

continue

continue abandons the rest of the current loop pass and jumps straight to the next one — the next condition check in a while, or the next index in a for. Use it to skip elements that do not apply without nesting the rest of the body inside an if: filter out empty slots, ignore inactive entities, or step over even numbers. Like break, it acts on the innermost loop only.

Example

program SumOdds {
  var total: int = 0

  handler Add phase Update {
    for i in 0 .. 10 {
      if i % 2 == 0 { continue }   # skip even numbers
      total = total + i
    }
  }
}
← All symbols