Relation:while

Repeat code as long an expression is true.

Description

while expression

expressionlist

end while

Parameters

expression: any valid expression. While the result is 1, then it is true.

Examples

set x 10
while x > 0
echo x
set x x-1
end while
10
9
8
7
6
5
4
3
2
1

Comments

Don't forget to set a condition to break the loop or it will be endless.

If you cannot stop, use command-period or close the file.

See also

if