json.get

From RPTools Wiki
Revision as of 12:09, 24 December 2008 by Craig (talk | contribs)
Jump to navigation Jump to search

Function json.get

Introduced in MapTool 1.3b49

Returns the value in a json array at the specified index, or returns the value from json object for the specified key.

Usage

[h: jarr = json.get(jarr, index)]
[h: jarr = json.get(jobj, key)]


Examples

  [h:a=json.fromStrProp("a=1;b=44;c=12")] [json.get(a,"b")]
  [h:a=json.fromList("1,44,12")] [json.get(a,1)]

Returns

 44
 44