Anvil | Smiths Smiths | Register Register | Login Login |
Search:
Show links Show tools Show tree | Previous document Next document | njet.org > Anvil > Documentation > Language reference > Statements > Simple statements > Continue

Continue

Continue may occur only as long as there is at least one enclosing statement of the type block (which must be labeled), do, for, foreach, or while. Continue targets to the innermost statement of the given type (but not unlabeled block), or if a label is given, to the enclosing statement referred to by the label.

Continue continues to the next cycle (or to the start of a block) of the target statement, executing all passed finally statements.

When used inside switch statement two altenate forms are available:

  • With ``case´´ keyword, followed by constant expression pointing to existing case branch with same key. Execution is forwarded to given case.

  • With ``default´´ keyword, which effectily jumps to start of default brach (which must exist).

    These two forms come in handy for writing state machines.

      continue  := "continue" [ symbollabel ] [ stmt-modifier ] ";" 
      continue  := "continue" [ symbollabel ] "case" exprconstant  [ stmt-modifier ] ";" 
      continue  := "continue" [ symbollabel ] "default" [ stmt-modifier ] ";" 
    
    Contributes notes:
    Add a note
  • What's new | Anvil