indexValueStrProp: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function indexValueStrProp== Returns the value from the specified string property list at the specified index. The index for the [[Macros:string property ...)
 
m (Added delim to Usage and the parameters section.)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Function indexValueStrProp==
{{MacroFunction
|name=indexValueStrProp
|version=1.3b42
|description=
Returns the value from the specified [[Macros:string property list|string property list]] at the specified index. The index for the [[Macros:string property list|string property list]] starts at 0.
Returns the value from the specified [[Macros:string property list|string property list]] at the specified index. The index for the [[Macros:string property list|string property list]] starts at 0.


===Usage===
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: val = indexValueStrProp(prop, index)]
indexValueStrProp(proplist, index)
</source>
indexValueStrProp(proplist, index, delim)
</syntaxhighlight>
'''Parameters'''
{{param|proplist|String property list to extract data from.}}
{{param|index|The numerical index of the element you want returned.}}
{{param|delim|Delimiter between fields (default is ";").}}


 
|example=
===Examples===
<syntaxhighlight lang="mtmacro" line>
<source lang="mtmacro" line>
[indexValueStrProp("a=blah; b=doh; c=meh", 1)]
[indexValueStrProp("a=blah; b=doh; c=meh", 1)]
</source>
</syntaxhighlight>
Returns "doh".
Returns "doh".
}}
[[Category:String Property List Function]]

Latest revision as of 23:59, 14 November 2024

indexValueStrProp() Function

Introduced in version 1.3b42
Returns the value from the specified string property list at the specified index. The index for the string property list starts at 0.

Usage

indexValueStrProp(proplist, index)
indexValueStrProp(proplist, index, delim)

Parameters

  • proplist - String property list to extract data from.
  • index - The numerical index of the element you want returned.
  • delim - Delimiter between fields (default is ";").

Example

[indexValueStrProp("a=blah; b=doh; c=meh", 1)]
Returns "doh".