Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   Epsilon Extension Language
      . . .
      Initialization
      Statements
         Expression Statement
         If Statement
         Looping Statements
         Switch Statements
         Break and Continue Statements
         . . .
      Conversions
      . . .

Previous   Up    Next
If Statement  Epsilon Extension Language   Switch Statements


Epsilon User's Manual and Reference > Epsilon Extension Language > Statements >

Looping Statements

while ( expression )
        statement

In a while loop, the expression is evaluated. If nonzero, the statement executes, and the expression is evaluated again. This happens over and over until the expression's value is zero. If the expression is zero the first time it is evaluated, statement is not executed at all.

do
        statement
while ( expression);

A do while loop is just like a plain while loop, except the statement executes before the expression is evaluated. Thus, the statement will always be evaluated at least once.

for ( expression1; expression2; expression3 )
        statement

In a for loop, first expression1 is evaluated. Then expression2 is evaluated, and if it is zero EEL leaves the loop and begins executing instructions after statement. Otherwise the statement is executed, expression3 is evaluated, and expression2 is evaluated again, continuing until expression2 is zero.

You can omit any of the expressions. If you omit expression2, it is like expression2 is nonzero. while (expression) is the same as for (; expression; ). The syntax for (;;) creates an endless loop that must be exited using the break statement (or one of the other statements described below).



Previous   Up    Next
If Statement  Epsilon Extension Language   Switch Statements


Lugaru Copyright (C) 1984, 2012 Lugaru Software Ltd. All Rights Reserved.