json.remove

From RPTools Wiki
Revision as of 14:11, 24 December 2008 by Craig (talk | contribs) (New page: ==Function json.remove== '''Introduced in MapTool 1.3b49''' Removes a field from a Macros:json object, or the value at the specified index from a json array. ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function json.remove

Introduced in MapTool 1.3b49 Removes a field from a json object, or the value at the specified index from a json array.

Usage

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


Examples

  [h:a=json.fromStrProp("a=1;b=44;c=12")] [r:json.remove(a, "c")]
  [h:a=json.fromList("a,1,g,4")][r:json.remove(a,3)]

Returns

 {"a":1,"b":44}
 ["a",1,"g"]