This function iterates until its condition evaluates to nil, evaluating the statement at each iteration. The condition is evaluated before the statement, so it is possible for a while loop to iterate zero times.
Gamma> x = 0;
0
Gamma> while (x < 5) { princ (x, "\n"); x++; }
0
1
2
3
4
4
Gamma> x;
5
Gamma> See the Emulating the PID Loop section of the PID Emulator chapter, or the Common: The Text Message Display section of the Common: The Text Message Display chapter, or the Common: Starting and Stopping the Cascade TextLogger section of the Log Functions chapter in the Cogent Tools Demo and Tutorials book for examples of this function used in context.