for (roll option): Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 30: Line 30:


===Version Changes===
===Version Changes===
{{change|1.3b54|Changed the comparison operator when comparing the ''var'' to ''end'' when determining whether to continue executing a new iteration.  In b53 and earlier, on each iteration it compared if ''var'' was less than or equal to ''end''.  As of b54, it is now comparing if ''var'' is less than ''end''.  See the forum's bug [http://forums.rptools.net/viewtopic.php?f=27&t=7677 thread] for discussion.}}
{{change|1.3b54|Changed the comparison operator when comparing the ''var'' to ''end'' when determining whether to continue executing a new iteration.  In b53 and earlier, on each iteration it compared if ''var'' was less than or equal to ''end''.  As of b54, it is now comparing if ''var'' is less than ''end''.  See the forum's bug thread at [http://forums.rptools.net/viewtopic.php?f=27&t=7677] for details.}}


[[Category:Roll Option]]
[[Category:Roll Option]]
[[Category:Looping Roll Option]]
[[Category:Looping Roll Option]]

Revision as of 00:18, 20 April 2009

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

FOR Option

Introduced: Version 1.3.b46

Executes a statement for a number of iterations based on a start and end value.

Usage

[FOR(var, start, end): body]
[FOR(var, start, end, stepsize): body]
[FOR(var, start, end, stepsize, separator): body]

The var variable counts from start towards end during the loop, and the optional stepsize (default +1) is added to var at each iteration. Note that in the standard incrementing usage with a stepsize of 1, the body does not execute when var reaches end.

Example

[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.

Version Changes

  • 1.3b54 - {{{2}}}