While statement

Sometimes you must repeat a list of statements as long as a certain condition holds true. In BI# you can use the while statement for this purpose. It expects a Boolean expression and a list of statements. This process uses a while statement to print the numbers from 1 to 5:

#define EngineVersion 2.0
#define RuntimeVersion 2.0

void WhileStatementDemo()
@Description: "Demonstrates the usage of the while statement.";
@Category: "Demo";
{
     int x = 1;
     while (x <= 5)
     {
          WriteLine(x);
          x = x + 1;
     }
}

The while statement is not available in engine version 1.0.