getStrProp: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Missing a ))
(Applied Template:MacroFunction)
Line 1: Line 1:
==Function getStrProp==
{{MacroFunction
 
|name=getStrProp
|description=
Returns the value associated with a key from the specified [[Macros:string property list|string property list]].  
Returns the value associated with a key from the specified [[Macros:string property list|string property list]].  


==Usage==
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: props = getStrProp(propList, key)]
[h: props = getStrProp(propList, key)]
</source>
</source>


 
|example=
===Examples===
To get the name from a weapon [[Macros:string property list|string property list]]
To get the name from a weapon [[Macros:string property list|string property list]]
<source lang="mtmacro" line>
<source lang="mtmacro" line>
Line 15: Line 15:
Name of Weapon = [r: getStrProp(weapon, "name")]
Name of Weapon = [r: getStrProp(weapon, "name")]
</source>
</source>
Returns "longsword".
Returns {{code|longsword}}.
}}
[[Category:String Property List Function]]

Revision as of 04:00, 8 March 2009

getStrProp() Function

Returns the value associated with a key from the specified string property list.

Usage

[h: props = getStrProp(propList, key)]

Example

To get the name from a weapon string property list
[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]
Name of Weapon = [r: getStrProp(weapon, "name")]
Returns longsword.