Hi I trying to use the class cJsonObject until now I used cJSONParser that was created by some developers, it is ok but with very complex jason can be a problem to parse the objects/array.
I found that new cJsonObject class is much easiest to use, but I have found first problem with array member
I cannot found any documentation to understand how to read the arrayGet JsonType of hoMember to iType
If (itype=jsonTypeArray) Begin
// how I can parse the array ?
Move (MemberCount(hoMember) - 1) to imem // it return zero in this case
end
documentation do not say nothing about jsonTypeArray that I found on the class source
this is documentation aboyt jsontype
Object type:
Constant Meaning jsonTypeNull The JSON null value. jsonTypeBoolean Value of type Boolean jsonTypeDouble Value of type double jsonTypeInteger Value of type integer jsonTypeString Value of type string
in the class source
maybe jsonTypeArray it is not yet implemented? or only missing same documentation/sample? if this is the case someone/dataaccess know how to use it?Enum_List
Define jsonTypeNull
Define jsonTypeBoolean
Define jsonTypeDouble
Define jsonTypeInteger
Define jsonTypeObject
Define jsonTypeArray
Define jsonTypeString
End_Enum_List
the json member array that is read is "results" it is read like jsonType Array. see part of json string
regards.....
"results":
[{"providedLocation":
{"location":"via roma 3, 18039, ventimiglia, im"},
"locations":[{"street":"Via Roma 3","adminArea6":"","adminArea6Type":"Neighborhood" ,"adminArea5":"Ventimiglia","adminArea5Type":"City ","adminArea4":"","adminArea4Type":"County","admin Area3":"Liguria","adminArea3Type":"State","adminAr ea1":"IT","adminArea1Type":"Country","postalCode": "18039","geocodeQualityCode":"L1AAA","geocodeQuali ty":"ADDRESS","dragPoint":false,"sideOfStreet":"N" ,"linkId":"IT/ADDR/p0/4875937","unknownInput":"","type":"s","latLng":{"l at":43.79204,"lng":7.60607},"displayLatLng":{"lat" :43.79204,"lng":7.60607},"mapUrl":"https://www.mapquestapi.com/staticmap/v5/map?key=xxxxxxxxxxxxxxxxxxxxxxxx&type=map&size=225 ,160&locations=43.79204,7.60607|marker-sm-50318A-1&scalebar=true&zoom=15&rand=486291453"}]}]}
Franco