/
while loop

while loop

A while loop repeats a block of code as long as a given condition is true.

for condition do trace("executed code") end

For example: This while loop below will iterate and trace 1 to 5

local i = 1 while i <= 5 do trace("Iteration: "..i) i = i + 1 end

We can see this example clearly in the Translator by navigating the loops in the Annotation Windows and see the iteration change.

 

Related content

Using a table as a function argument
Using a table as a function argument
Read with this
for loop
More like this
Infinite loop
More like this
Loops
More like this
Error Stack Trace
Error Stack Trace
More like this
See loops
See loops
More like this