Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Telix/SALT v3.15 & RS-232, Hayes - <b>while</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  WHILE

  The while statement is used to loop continuously while a certain
  condition is true. It has the form

       while (<expression>)
         <statement>

  <statement> would continue to be repeated over and over while
  <expression> evaluated to non-zero (TRUE). Note that if the ex-
  pression evaluates to 0 (FALSE) from the beginning, the statement
  will never be executed. Again, multiple statements may be used by
  surrounding them in curly braces. A few examples are:

       while (stat != -1)
         stat = myfunc();

       while (num < 100)
         {
          printn(num);
          prints("");
          num = num + 1;
         }

       while (1)
         {
          if (func1())
            return 0;

          func2();
         }

  Again, be careful to not place a semicolon after the parenthesis
  ending the expression.

See Also: break continue do for operators expressions statements

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson