Below is an example of a simple while_statement
// This will loop ten times
i=0;
while(i < 10)
applog("We’re still in the loop since i=",i);
i++;
endwhile
However any expr can be used – the loop will continue until the expression evaluates to 0 (zero):
// This will loop forever
while(1)
applog("Looping forever");
endwhile
Similarly the following will result in an infinite loop and using assignment expressions like this is often the cause of bugs where in fact the comparison_expression was meant.
// a is assigned the value 10 conditional expression, thus 10 is the result of this expression
// so this will loop forever
a=0;
while(a=10)
applog("Looping forever");
endwhile