listFormat

From RPTools Wiki
Revision as of 18:31, 21 January 2009 by Lindharin (talk | contribs) (New page: ==Function assert== Returns a custom-formatted version of the list. ===Usage=== <source lang="mtmacro" line> [ listFormat(list, listFormat, itemFormat, separator) ] </source> * listFormat...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function assert

Returns a custom-formatted version of the list.

Usage

[ listFormat(list, listFormat, itemFormat, separator) ]
  • listFormat is a string that is emitted once. It should contain the text "%list", which is replaced with the formatted items.
  • itemFormat is emitted once per item. Each instance of "%item" in the string is replaced with the value of the list item.
  • separator is emitted in between the formatted items.

Example

[ listFormat("apple,bear,cat", "BEGIN LIST<br>%list<br>END LIST", "This item is: %item", "<br>") ]

(prints items on separate lines)