setStrProp: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function setStrProp== Returns a[Macros:string property list|string property list]] with the key set to the value passed in. ==Usage== <source lang="mtmacro" line> [h: props = setStrPr...)
 
m (Applied Template:MacroFunction)
Line 1: Line 1:
==Function setStrProp==
{{MacroFunction
|name=setStrProp
|description=
Returns a [[Macros:string property list|string property list]] with the key set to the value passed in.


Returns a[Macros:string property list|string property list]] with the key set to the value passed in.
|usage=
 
==Usage==
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: props = setStrProp(propList, key, value)]
[h: props = setStrProp(propList, key, value)]
</source>
</source>


 
|example=
===Examples===
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]
[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]
Line 15: Line 15:
</source>
</source>
Returns "longsword".
Returns "longsword".
}}
[[Category:String Property List Function]]

Revision as of 04:40, 9 March 2009

setStrProp() Function

Returns a string property list with the key set to the value passed in.

Usage

[h: props = setStrProp(propList, key, value)]

Example

[h: weapon = "name=longsword; damage=1d8; maxdamage=8"]
[h: weapon = setStrProp(weapon, "value", 10)]
Returns "longsword".