Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is JSON and is it better than xml etc
Message
From
22/01/2019 15:58:05
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
22/01/2019 14:42:25
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01665642
Message ID:
01665648
Views:
111
>Hi all,
>
>In discussion with another developer about re-doing a system. This system interacted with a document database and the integration with the VFP app was done with calls that always returned an xml string. The other developer had mentioned using json to return back data from the server.
>
>I have done the wikipedia lookup and have an idea what json data looks like but have some questions:
>
>1) are their json parsers out there for VFP or would I have to write my own; with xml, there were the built in xml functions which I used

Yes and you can get them from VfpX. I was using two of them in the last couple of years and had very few problems.

>2) does json have any advantages over xml?

Much shorter, no header with definition, no frills, no extra attributes, one standard and not messed up by Microsoft. Therefore parsers are faster and simpler and you can actually use those written in Fox, without any COM (and, believe it or not, the COM parser may complain about empty url being insecure :facepalm:, which json parser doesn't even care of). You can easily check the validity of your json on http://jsonlint.com.

>3) any "gotchas" to watch out for?

There are at least two ways to write a date - as a date() function with parameters, or as a date string - and when a string, there may be some gotchas about the format... Read about that, I forgot what the issue was, I got mine working and don't remember what exactly the problem was, not to mention what the solution was. It's when you try three things, one works, you don't necessarily memorize which.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform