Contents | Index | < Browse | Browse >
WHILE Argument OPERATOR Argument
ENDWHILE
AND, OR
===================================================================
You use this command as follows :
var = 1 ; set var equal to 1
WHILE $var < 10 ; while var is less than 10
say '$varn' ; print the current value of var
++var ; increase var by 1
ENDWHILE ; go back to WHILE and do it again,
; until $var is 10
- this will print out numbers 1-9
The arguments and operators have the same meaning as for IF, so
see it for explanation. OR and AND can be attached to WHILE, just
like to IF.
You can have While within While, up to 126 levels.
A while statement is often called a "LOOP" because it just keeps
looping and re-doing the code in between the while/endwhile until
the condition you set in the while statement has been satisfied.
This is *very* useful in many situations, so learn how to use it!