Skip to content

while

Control flow

Loop while the condition is true. There is no do/while.

while (cond) {
}
NameTypeDescription
condboolChecked before each iteration.

None.

while … do … end

There is no continue. Use nested if or restructure. break leaves the loop.

while (true) {
post("tick");
break;
}

Emits:

while true do
print("tick")
break
end

for · range-for · break