getStrProp: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
m (Missing a ))
Line 13: Line 13:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]
[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]
Name of Weapon = [r: getStrProp(weapon, "name"]
Name of Weapon = [r: getStrProp(weapon, "name")]
</source>
</source>
Returns "longsword".
Returns "longsword".

Revision as of 10:09, 5 February 2009

Function getStrProp

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

Usage

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


Examples

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".