for (roll option)
This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
[for():] Roll Option
Executes a statement for a number of iterations based on a start and end value.
[for(var, start, end): body]
[for(var, start, end, stepsize): body]
[for(var, start, end, stepsize, separator): body]
var variable counts from
end during the loop, and the optional
+1) is added to
var at each iteration. Note that in the standard incrementing usage with a
body does not execute when
stepsize must be integer and not 0. Floating values will be rounded down.
list_separator default value is
",". Some examples of other useful separators: nothing
" " and break
[for(i,0,10): "i is now " + i]
Counts up from 0 to 9.
[for(i,10,0,-2): "i is now " + i]
Counts down even numbers from 10 to 0.
- 1.3b54 - Changed the comparison operator when comparing the
endwhen determining whether to continue executing a new iteration. In version 1.3b53 and earlier, on each iteration it compared if
varwas less than or equal to
end. As of version 1.3b54, it is now comparing if
varis less than