listCount: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Corrected typo.)
Line 1: Line 1:
{{MacroFunction
{{MacroFunction
|name=listCount
|name=listCount
|descriptio=
|description=
Returns the number of items in a [[Macros:string list|string list]].
Returns the number of items in a [[Macros:string list|string list]].


Line 12: Line 12:
If delim is not specified then the default value of ',' is used as the value separator in the [[Macros:string list|string list]]
If delim is not specified then the default value of ',' is used as the value separator in the [[Macros:string list|string list]]


|example=
|examples=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r: listCount("This, is, a, test")]
[r: listCount("This, is, a, test")]

Revision as of 02:44, 9 March 2009

listCount() Function

Returns the number of items in a string list.

Usage

[h: count = listCount(list)]
[h: count = listCount(list, delim)]

If delim is not specified then the default value of ',' is used as the value separator in the string list

Examples

[r: listCount("This, is, a, test")]

Returns 4

[r: listCount("This: is: a: test",":")]
Returns 4