COG Keyword - do..while

Do..while is similar to while keyword, but it will run the code block before checking the condition. Remember to put a semicolon after the while statement.

Syntax:

  do
  {
      // run code
  }
  while (condition);

Example:

  do
  {
      i = i + 1;
  }
  while (i < var2);
  • Create:
This page was last modified 16:59, 19 December 2005.   This page has been accessed 256 times.