sait / vfpjson

Json encoder and decoder for VFP Visual Fox Pro
31 stars 60 forks source link

ARRAY #7

Closed SnipedCode closed 3 years ago

SnipedCode commented 4 years ago

Hi,

I try to deal with ARRAY and FoxPro crash.

lcJSON = '[{"AppID":"Android-1598459250","MobileVer":"1.0","Direction":0.0,"EventCode":"on","EventTime":"2020-08-26 18:24:37","Latitude":"46","Longitude":"-73","Speed":"0.00000"}]'
oJson = Json_decode(lcJSON)
?oJson.array.array(1).AppID

How to get my value when it's a ARRAY?

geo101 commented 4 years ago

For the "Direction" field, put quotes around the 0.0. Try this...

lcJSON = '[{"AppID":"Android-1598459250","MobileVer":"1.0","Direction":"0.0","EventCode":"on","EventTime":"2020-08-26 18:24:37","Latitude":"46","Longitude":"-73","Speed":"0.00000"}]'
CodyWMitchell commented 3 years ago

Hi,

I try to deal with ARRAY and FoxPro crash.

lcJSON = '[{"AppID":"Android-1598459250","MobileVer":"1.0","Direction":0.0,"EventCode":"on","EventTime":"2020-08-26 18:24:37","Latitude":"46","Longitude":"-73","Speed":"0.00000"}]'
oJson = Json_decode(lcJSON)
?oJson.array.array(1).AppID

How to get my value when it's a ARRAY?

Ever find a solution to this issue? I'm running into the same thing

ignaciogutierrez commented 3 years ago

? oJson.array(1).AppID ? oJson.array[1].appid