json.type: Difference between revisions
Jump to navigation
Jump to search
(New page: ==Function json.type== '''Introduced in MapTool 1.3b49''' Returns a string which contains the type of Macros:json object that is passed in. Return values are * ARRAY - The object ...) |
Verisimilar (talk | contribs) m (Applied Template:MacroFunction) |
||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
|name=json.type | |||
|version=1.3b49 | |||
|description= | |||
Returns a string which contains the type of [[Macros:json object|json object]] that is passed in. | Returns a string which contains the type of [[Macros:json object|json object]] that is passed in. | ||
Return values are | Return values are | ||
Line 11: | Line 9: | ||
* UNKNOWN - It is neither a [[Macros:json array|json array]] or [[Macros:json object|json object]]. | * UNKNOWN - It is neither a [[Macros:json array|json array]] or [[Macros:json object|json object]]. | ||
|usage= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h: jarr = json.type(val)] | [h: jarr = json.type(val)] | ||
</source> | </source> | ||
|examples= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h:a=json.fromStrProp("a=1;b=44;c=12")] [r:json.type(a)] | [h:a=json.fromStrProp("a=1;b=44;c=12")] [r:json.type(a)] | ||
Line 28: | Line 25: | ||
ARRAY | ARRAY | ||
UNKNOWN | UNKNOWN | ||
}} | |||
[[Category:JSON Function]] |
Revision as of 02:17, 9 March 2009
json.type() Function
• Introduced in version 1.3b49
Returns a string which contains the type of json object that is passed in.
Return values are
- ARRAY - The object is a json array.
- OBJECT - The object is a json object.
- UNKNOWN - It is neither a json array or json object.
Usage
[h: jarr = json.type(val)]
Examples
[h:a=json.fromStrProp("a=1;b=44;c=12")] [r:json.type(a)]
[h:a=json.fromList("a,1,g,4")][r:json.type(a)]
[r:json.type("some thing or other")]
Returns
OBJECT ARRAYUNKNOWN