WHILE
Command: #while {conditional} {commands}
This command works similar to a 'while' statement in other languages.
When a 'while' command is encourated, the conditional is evaluated,
and if TRUE (any non-zero result) the commands are executed. The
'while' loop will be repeated indefinitely until the conditional is
FALSE or the #BREAK or #RETURN commands are found.
The 'while' statement is only evaluated if it is read, so you must
nest it inside a trigger, like an alias or action.
The conditional is evaluated exactly the same as in the 'math' command.
Example: #math cnt 0;#while {$cnt < 20} {#math cnt $cnt + 1;say $cnt}
Comment: See '#help math', for more information.
Related: statements
|