Parameter | Description |
---|---|
sMember | Member name or array index |
Hande of a member of the JSON object
Function Member String sMember Returns Handle
Call: | Get Member sMember to HandleVariable |
Gets a member of the JSON object by its name or array index.
The JsonType and MemberJsonType functions can be used to determine the type of a specific node.
The example below shows how to parse a string with JSON. If successful it reads the age member from the details object. If not successful it uses ReportParseError that will generate an error.
Handle hoJson hoDetails Boolean bSuccess Integer iAge Get Create (RefClass(cJsonObject)) to hoJson Get ParseString of hoJson '{"name" : "John", "details" : {"age" : 31, "male" : true}}' to bSuccess If (bSuccess) Begin Get Member of hoJson "details" to hoDetails Get MemberValue of hoDetails "age" to iAge Showln ("Age of John: " + String(iAge)) Send Destroy of hoDetails End Else Begin Send ReportParseError of hoJson End Send Destroy of hoJsonSee Also