json.get: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Verisimilar (talk | contribs) m (Applied Template:MacroFunction) |
||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
|name=json.get | |||
|version=1.3b49 | |||
|description | |||
Returns the value in a [[Macros:json array|json array]] at the specified index, or returns the value from [[Macros:json object|json object]] for the specified key. | Returns the value in a [[Macros:json array|json array]] at the specified index, or returns the value from [[Macros:json object|json object]] for the specified key. | ||
|usage= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h: jarr = json.get(jarr, index)] | [h: jarr = json.get(jarr, index)] | ||
Line 13: | Line 11: | ||
</source> | </source> | ||
|example= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h:a=json.fromStrProp("a=1;b=44;c=12")] [json.get(a,"b")] | [h:a=json.fromStrProp("a=1;b=44;c=12")] [json.get(a,"b")] | ||
Line 23: | Line 20: | ||
44 | 44 | ||
44 | 44 | ||
}} | |||
[[Category:JSON Function]] |
Revision as of 02:09, 9 March 2009
json.get() Function
• Introduced in version 1.3b49
Usage
[h: jarr = json.get(jarr, index)]
[h: jarr = json.get(jobj, key)]
Example
[h:a=json.fromStrProp("a=1;b=44;c=12")] [json.get(a,"b")]
[h:a=json.fromList("1,44,12")] [json.get(a,1)]
Returns
4444