json.append: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function json.set== '''Introduced in MapTool 1.3b49''' Appends values to the end of a json array. An empty string ("") can be used to represent an empty [[Macros...)
 
Line 8: Line 8:
===Usage===
===Usage===
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: jarr = json.get(jarr, value, ...)]
[h: jarr = json.append(jarr, value, ...)]
</source>
</source>



Revision as of 14:05, 24 December 2008

Function json.set

Introduced in MapTool 1.3b49 Appends values to the end of a json array. An empty string ("") can be used to represent an empty json array to append the values to.

Usage

[h: jarr = json.append(jarr, value, ...)]


Examples

  [h:a=json.fromList("a,1,g,4")][r: json.append(a, 55)]
  [r: json.append("", 1, 5, 8, 33)]

Returns

  ["a",1,"g",4,55]
  [1,5,8,33]