json.set: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Applied Template:MacroFunction)
(No difference)

Revision as of 02:15, 9 March 2009

json.set() Function

Introduced in version 1.3b49

Usage

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

Example

  [json.set("{}", "a", 5)]
  [json.set("", "a", 5, "b", 8)]
  [json.set(json.fromList("1,3"), 0, 8)]

Returns

 {"a":5}
 {"a":5, "b":8}
[8, 3]