foreach (roll option)

From RPTools Wiki
Revision as of 04:13, 5 April 2009 by Verisimilar (talk | contribs)
Jump to navigation Jump to search

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

FOREACH Option

Introduced: Version 1.3.b46

Iterates over the contents of a string list in the format "item1, item2, item3"

Usage

[FOREACH(var, list): body]
[FOREACH(var, list, output_separator): body]
[FOREACH(var, list, output_separator, list_separator): body]

Example

[h: enemyList="Orcs, Goblins, Ogres, Trolls"]
[FOREACH(enemy, enemyList, "<br>"): "You really hate " + enemy]

Outputs

You really hate Orcs
You really hate Goblins
You really hate Ogres
You really hate Trolls