Statements: while loop

The while loop iteration statement lets you repeat a nested statement.

Syntax

while(condition)statement

Discussion

The while loop statement executes the nested statement repeatedly as long as the condition evaluates to the boolean value true. The condition is evaluated at the begin of every iteration. To execute multiple statements within the loop, you can group those together within a block statement. For example:

// Find the first visible view var Core::View view = FindNextView( null, Core::ViewState[ Visible ]); // Hide all text views existing within the current GUI component while ( view != null ) { var Views::Text textView = (Views::Text)view; // Is this a text view? if ( textView != null ) textView.Visible = false; // Continue with the next view view = FindNextView( view, Core::ViewState[ Visible ]); }