If you try my JSON_Helper.pbi:vwidmer wrote:how to implement code to handle something like this:
Code: Select all
{"positions":[[123,456,"TEST1"],[234,212,"TEST2"],[982,273,"TEST3",]],"time_on_server":null}
Code: Select all
IncludeFile "JSON_Helper.pbi"
JSON$ = ReplaceString( "{'positions':[[123,456,'TEST1'],[234,212,'TEST2'],[982,273,'TEST3']],'time_on_server':null}" , "'", #DQUOTE$)
ParseJSON(0, JSON$ )
*Pos = JSONArrayFromPath( MainJSONObject(0), "positions")
*Entry = FirstJSONChild(*Pos)
While (*Entry)
Debug JSONIntegerFromPath(*Entry, "[0]")
Debug JSONIntegerFromPath(*Entry, "[1]")
Debug JSONStringFromPath(*Entry, "[2]") + #LF$
*Entry = NextJSONChild(*Pos, *Entry)
Wend
123
456
TEST1
234
212
TEST2
982
273
TEST3