Public Function JSONParse(ByVal JSONPath As String,ByVal JSONString As String) As Variant Dim JSON As Object Set JSON = CreateObject("MSScriptControl.ScriptControl") JSON.Language = "JScript" JSONParse = JSON.eval("JSON=" & JSONString & ";JSON." & JSONPath & ";") Set JSON = Nothing End Function
@H_301_16@
"programmers":[{
@H_301_16@
"firstName":"Brett",
@H_301_16@
"lastName":"McLaughlin",
@H_301_16@
"email":"aaaa"
@H_301_16@
},{
@H_301_16@
"firstName":"Jason",
@H_301_16@
"lastName":"Hunter",
@H_301_16@
"email":"bbbb"
@H_301_16@
},{
@H_301_16@
"firstName":"Elliotte",
@H_301_16@
"lastName":"Harold",
@H_301_16@
"email":"cccc"
@H_301_16@
}],
@H_301_16@
"authors":[{
@H_301_16@
"firstName":"Isaac",
@H_301_16@
"lastName":"Asimov",
@H_301_16@
"genre":"sciencefiction"
@H_301_16@
},{
@H_301_16@
"firstName":"Tad",
@H_301_16@
"lastName":"Williams",
@H_301_16@
"genre":"fantasy"
@H_301_16@
},{
@H_301_16@
"firstName":"Frank",
@H_301_16@
"lastName":"Peretti",
@H_301_16@
"genre":"christianfiction"
@H_301_16@
}],
@H_301_16@
"musicians":[{
@H_301_16@
"firstName":"Eric",
@H_301_16@
"lastName":"Clapton",
@H_301_16@
"instrument":"guitar"
@H_301_16@
},{
@H_301_16@
"firstName":"Sergei",
@H_301_16@
"lastName":"Rachmaninoff",
@H_301_16@
"instrument":"piano"
@H_301_16@
}]
} ----------------- JSONParse("programmers.length",Data) 3 JSONParse("musicians[1].instrument",Data) piano