a port of the Processing Visualization Language


example pic
int i=0;

while(i<80) {

  line(30, i, 80, i);

  i = i + 5;

Description Controls a sequence of repetitions. The while structure executes a series of statements continuously while the expression is true. The expression must be updated during the repetitions or the program will never "break out" of while.

This function can be dangerous because the code inside the while() loop will not finish until the expression inside while() becomes true. It will lock out all other code from running (mouse events will not be updated, etc.) So be careful because this can lock up your code (and sometimes even the Processing environment itself) if used incorrectly.
while (expression) {


expression a valid expression
statements one or more statements
Usage Web & Application
Related for()

This reference is licensed under the CC BY-NC-SA 2.0 license:

Creative Commons License
Fork me on GitHub