json.type: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page json.type to Json.type without leaving a redirect: Converting page title to first-letter uppercase)
No edit summary
 
(One intermediate revision by one other user not shown)
Line 11: Line 11:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: jarr = json.type(val)]
[h: jarr = json.type(val)]
</source>
</syntaxhighlight>


|examples=
|examples=
<source lang="mtmacro" line>
<syntaxhighlight 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)]
   [h:a=json.fromList("a,1,g,4")][r:json.type(a)]
   [h:a=json.fromList("a,1,g,4")][r:json.type(a)]
   [r:json.type("some thing or other")]
   [r:json.type("some thing or other")]
</source>
</syntaxhighlight>


Returns
Returns

Latest revision as of 17:39, 15 March 2023

json.type() Function

Introduced in version 1.3b49
Returns a string which contains the type of JSON variable that is passed in.

Return values are

 

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
 ARRAY
UNKNOWN