How to get JSON value

xalion

Member
Licensed User
Longtime User
I have a json file like :
{"topics":
[{"XM":"\u8d3e\u54f2","XH":"1710","HJ":"84"},
{"XM":"\u5f20\u5b81\u5a1f","XH":"1703","HJ":"84"},
{"XM":"\u5434\u6e05\u6653","XH":"1406","HJ":"84"},
{"XM":"\u4e95\u7ea2\u8273","XH":"1021","HJ":"84"},
{"XM":"\u5b59\u6d77\u5a1c","XH":"1802","HJ":"84"}],
"totalCount":"466"}

I can use fllowe code to access XM:
Dim JSON As JSONParser
Dim Master,recordcount As Map
Dim records As List

Dim XINXI As Map

JSON.Initialize(File.ReadString(File.DirAssets, "qcm.json"))

master = JSON.NextObject
records=master.Get("topics")
Log(records.Size)
For i=0 To records.Size-1
XINXI=records.Get(i)
Log(XINXI.Get("XM"))
Next

how to get totalcount'value?
 
Top