setStrProp

From RPTools Wiki
Revision as of 01:02, 4 April 2009 by Merkuri (talk | contribs) (Fixed existing example and added a new one)
Jump to navigation Jump to search

setStrProp() Function

Introduced in version 1.3b42
Returns a string property list with the key set to the value passed in.

Usage

setStrProp(propList, key, value)

Examples

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

Returns "name=longsword ; damage=1d8 ; maxdamage=8 ; value=10 ; "

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