json.length

From RPTools Wiki
Revision as of 13:08, 24 December 2008 by Craig (talk | contribs) (New page: ==Function json.length== '''Introduced in MapTool 1.3b49''' Returns the number of fields in a Macros:json object or number of elements in a Macros:json array. ===Usage=== <...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function json.length

Introduced in MapTool 1.3b49

Returns the number of fields in a json object or number of elements in a json array.


Usage

[h: len = json.length(jobj)]
[h: len = json.length(jarr)]


Examples

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

Returns

 3
 4