for tag
Creates a loop in the document tree. Code inside the loop is invoked repeatedly for a specified number of iterations.
Sample usage
<i:for 1 limit=10 do=i> yields the list of numbers 1 2 3 4 5 6 7 8 9 10
Fields
- Default field: The counter value of the current iteration. Can be initialised to the required starting value. The default starting value is 1.
- do: the code to invoke repeatedly, for each iteration of the loop.
- limit: the counter value of the final iteration. The loop will terminate after this iteration is invoked.
Notes
- A for loop executes synchronously and user interaction is not possible while a loop is running.
- An alternative to the for loop that works asynchronously is the timer tag, which also invokes code repeatedly, except the code is invoked by a repeating time interval event which allows for user interaction between iterations.
- To avoid degrading the user experience, synchronous looping within ioL is limited to 4096 contiguous iterations at a time (this number may vary between machine architectures and includes interations created by nested loops). To keep the user interface responsive, any significant data processing and computation should instead be done natively by the app itself, not within the user's interface.