Action: Repeat(label ID, times, count)

Related Actions: gosub, gosubrandom, goto, gotorandom, exitloop, exitevent
Related Events: label
See also: FKiSS, Events, Actions

repeat(label ID, times, count)

First defined in: FKiSS4
For the given number of times, the specified label is called as if with gosub(). Before each call, the variable count is set to the current iteration of the loop (starting from 1).

label ID

label ID may be a label ID (number or symbolic name) or a variable representing a label ID number.

times

times may be a number or a variable. This value is evaluated before the loop is begun so changing the value of a variable will not affect the number of loops.

count

count must be a variable name.

Example:

;@ repeat(100, 5, N) ; Call subroutine 100 five times, setting variable N to the loop count each time.
;@ repeat(MyLabel, 5, Count)