COG Keyword - break

Continue execution at statement after containing loop (if, for, while, or do..while). That is, break out of the loop.

Using break in JK is a syntax error, even when used as an identifier. Simply put, don't ever use break as a keyword, symbol, call handler name, or goto label in JK. This keyword does function correctly in MotS.

Example of using a goto as a replacement for break statement:

  for (i = 0; i < 3; i = i + 1)
  {
     if (j == 42)
     {
        goto AfterForLoop;
     }
  }
AfterForLoop:
  // This line is reached after "for" loop is done, or when j == 42.
  • Create:
This page was last modified 00:10, 26 August 2008.   This page has been accessed 400 times.