repeat
repeat (expression [, variable]) { statements } [ else { statements } ]
repeat (expression [, variable]) statement; else : statement
repeat is a very simple loop function where a fixed number of repetitions is specified and the subsequent block or statement will be exececuted accordingly. An optional loop index can be picked up with the 2nd function parameter. Note that the loop cannot be influenced with the index variable, but the break and continue statements are available for this.
Indirect parameter passing is disabled
None
1..2
No. | Type | Description |
---|---|---|
1 input |
numeral | Number of repetitions Specify the number of repetitions Default value: n/a |
2 code |
variable :string |
iterator value This variable begins with 0 and ends with repetition count - 1. This variable is updated by this function in order to provide the value of the current parameter element. It is a copied value. Modifying this variable will not influence the loop |
none
repeat (3) echo(Hello);
repeat ( 5, a[] )
{
print(a[],' ');
}
echo;
Hello
Hello
Hello
# Invalid Value # 1 2 3 4