The format of the while statement is:
while ( Conditional-expression )
If the conditional expression satisfies the condition, the statement in the while statement is executed from the beginning. If the condition is not met, execution moves to the next of the endwhile.
If the execution reached "continue" or "endwhile", execution moves to the conditional expression and resumes the loop from the evaluating.
If the execution reached "break", execution moves to the next of the endwhile.
A keyword that indicates that it is a while statement.
There are two expressions that can be a conditional expression.
An expression that returns a bool class.
An expression that returns a number: int, long, and real class.
If it returns a bool class, the statement in the section will be executed if true.
If it returns a number, the statement in the section will be executed if it is not zero.
The conditional expression is re-evaluated at the beginning of the loop. Therefore, the restart position of the while loop is a conditional expression.
If the conditional expression returns a proxy class, the entity of the proxy is automatically used. The result is the same as calling the Entity getter of the proxy class.
proxy pro = new proxy(true);
while(pro) // pro.Entity is used.
Since it is used as a conditional expression, the entity of the proxy must be a bool class or a number.
The while statement generates a scope.
Variables declared in the scope are re-declared per loop and new instances are assigned.
It does not carry over the value of the previous loop to the next loop.
When execution reaches the while, a scope is generated and the reserved variable __count is defined.
__count is a variable of the int class. It is initialized with the number of loops starting from zero.
__count does not cause an overflow. If __count exceeds the maximum value of the int, it returns to zero.
The scope has already been generated when evaluating the conditional expression. Therefore, if you used a reserved variable in a conditional expression, the reserved variable is the one defined by the current while statement.
The statements within a while statement are optional. You can place statements as many as you want.
It is a keyword that indicates the end of the while statement.
You can use the abbreviation "ew" instead of "endwhile". Note that "ew" is also a keyword.
open method void someMethod()
if (__count > 10)