getAllPropertyNames

From MapToolDoc
Jump to: navigation, search

getAllPropertyNames() Function

Introduced in version 1.3b48

Gets a list containing the the token property names that are defined in the campaign properties. The type of the value returned depends on the delimiter parameter.

  • If the delimiter is not specified then a string list is returned with the default value of ',' is used.
  • If the delimiter "json" then a JSON Array is returned.
  • Otherwise a string list is returned with the delimiter passed in.

Usage

  1. getAllPropertyNames()
  1. getAllPropertyNames(type)
  1. getAllPropertyNames(type, delim)

If type is specified then the string list contains the property names for that token property type, otherwise it will contain the token property names for all token property types. If delim is specified then it is used to separate the values in the string list, if it is not specified then it defaults to ','.

Examples

You can use the following code to print out all of the properties in the campaign properties list..

  1. Campaign Properties<br>
  2. [h: props = getAllPropertyNames()]
  3. [foreach(name, props, "<br>"): name]

If you have two token property sets, for instance "PC" and "NPC", you could print out all of the properties for the "PC" property set like so:

  1. PC Properties<br>
  2. [h: props=getAllPropertyNames("PC")]
  3. [foreach(name, props, "<br>"): name]

Version Changes

  • 1.3b49 - Added json delimiter option.