Loop
A repeating section of code.
While
The while section is the simplest loop. It will run the code section indefinitely, as long as the condition is met.
The section will be run only if the condition is true, and will run as long as the condition is true.
If the condition is always true, the section will be run indefinitely.
Because of this, users will want some kind of exit condition.
You can also exit the loop using the exit section
effect.
You can skip the current iteration using the continue loop
effect.
Loop X Times
This is a very simple loop that will run a given number of times before finishing, with no conditions or requirements.
This can be used to avoid repeating a piece of code multiple times.
You can also exit the loop using the exit section
effect.
You can skip the current iteration using the continue loop
effect.
Loop X in Y
The iterable loop is the most common loop type, and is very useful for dealing with lists and other collections of data.
Although this accepts any object, it is designed to take a list, array or some variety of collection.
For each item in the list, that item is put into the {item}
variable for the loop iteration.
An implicit array may also be used as the list to loop.
The first argument is used to store the object during the loop.
This can be used in conjunction with the function set behaviour to pass loop values to a function automatically.
This example uses the inline form of the loop section.
Last updated