Manual – IPOSplus®
199
16
while
Compiler – Constructions
Example
The if query with the continue statement means variable H2 is no longer incremented as
soon as H1 is greater than 32. This means when the loop is finished, the value of vari-
able H1 is 40 and that of H2 is 6.
If a break statement is processed in the statement block, this means the program exits
the for loop at that point. The loop is no longer continued.
Example
The if query with the break statement means that the loop is exited as soon as H1 is
greater than 32. This means that when the loop is exited, the value of variable H1 is 34
and that of H2 is 6.
16.3 while
16.3.1 Syntax
The while statement is a conditional loop which performs the statement for as long as
the value of the expression is TRUE (not equal to zero). The statement is never per-
formed if the expression never has the value TRUE. The expression is always pro-
cessed before the statement.
The statement can also be a statement block in which several statements can be spec-
ified.
The expression can also be made up of several logically interlinked conditions.
Example
H1 = 20;
H2 = 0;
for ( H0 = 0; H0 < 10; ++H0 )
{
H1 = H1 + 2;
if ( H1 > 32 )
continue;
++H2;
}
H1 = 20;
H2 = 0;
for ( H0 = 0; H0 < 10; ++H0 )
{
H1 = H1 + 2;
if ( H1 > 32 )
break;
++H2;
}
: while ( expression )
// Statement
H2 = 0;
H1 = 10;
while ( H1 > 5 )
{
H2 = H2 + 1;
--H1;
}
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n