setStrProp

From MapToolDoc
Jump to: navigation, search

setStrProp() Function

Introduced in version 1.3b42

Returns a String Property List with the key set to the value passed in.

Usage

  1. setStrProp(propList, key, value)

Parameters

  • propList - The String Property List affected by this function.
  • key - The key in the specified String Property List that will have its value set.
  • value - The value that the specified key will be set to.

Examples

Add a new key to an existing String Property List:

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

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

Change the value of a key in an existing String Property List:

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

Returns "name=longsword ; damage=1d6 ; maxdamage=8 ; "

See Also

getStrProp()