while (<condition>) <action>
while (<condition>) [{ <action> }]
The WHILE loop is a sort of hybrid between the FOR loop and the IF control statement. It allows for repetitive action, as with FOR, but the loop iterates (performs the action) only if a specific condition is met, as with IF.
The “condition” portion may contain any comparison or assignment allowed in an IF statement.
To display a warning message 3 times:
@ xx = 3 while ( xx > 0 ) { echo WARNING! This ship will self destruct in $xx seconds! @ xx-- }
A infinite loop that behaves like the Unix 'yes' command:
while ( 1 ) echo yes
UNTIL is the exact opposite of WHILE. It is essentially the same applying the negation operator (!) to the entire WHILE condition.