JSON - ExtractJSONList()
Posted: Tue Oct 23, 2018 9:39 pm
Hello all,
I don't understand why this show noting in the debugger.
I took the same structure of code as in the SpiderBasic exemple : ExtractJSONList()
Thanks for the help
I don't understand why this show noting in the debugger.
Code: Select all
Input$ = "[{'id':'0','name':'Daniel'},{'id':'1','name':'Pierre'},{'id':'2','name':'Jean'}]"
Structure Location
id.s
name.s
EndStructure
NewList Locations.Location()
ParseJSON(0, Input$)
ExtractJSONList(JSONValue(0), Locations())
ForEach Locations()
Debug Locations()\id + ", " + Locations()\name
Next
Code: Select all
Input$ = "[ {" + Chr(34) + "x" + Chr(34) + ": 10, " + Chr(34) + "y" + Chr(34) + ": 20}, " +
"{" + Chr(34) + "x" + Chr(34) + ": 30, " + Chr(34) + "y" + Chr(34) + ": 50}, " +
"{" + Chr(34) + "x" + Chr(34) + ": -5, " + Chr(34) + "y" + Chr(34) + ": 100} ]"
Structure Location
x.l
y.l
EndStructure
NewList Locations.Location()
ParseJSON(0, Input$)
ExtractJSONList(JSONValue(0), Locations())
ForEach Locations()
Debug Str(Locations()\x) + ", " + Str(Locations()\y)
Next
Thanks for the help