This project is read-only.
qdFoxJSON is pretty simple to use:

Load library:
SET PROCEDURE TO qdFoxJSON ADDITIVE
JSONStart()

Parse a JSON string into a object:
TEXT TO cPerson NOSHOW
fullname": "George Jetson",
"employer": "Spacely Sprockets",
"spouse": { "fullname": "Jane", "age": 20, "shopping": true },
"children": [ "Elroy", "Judy" ],
"isCool": true}
ENDTEXT

oPerson = JSON.Parse(cPerson) && Also: oPerson = JSONObject(cPerson)
?oPerson.fullName
?oPerson.Spouse.fullName
?oPerson.Children.Count
?oPerson.Children.Item[1]

*Serialize an object as a JSON string:*
LOCAL oCustomer
oCustomer = CREATEOBJECT("Empty")
ADDPROPERTY(oCustomer, "Id", "0001")
ADDPROPERTY(oCustomer, "fullName", "JOHN SMITH")

cCustomer = JSON.Encode(oCustomer)
?cCustomer --> {"id":"0001", "fullName" : "JOHN SMITH


Creating a JSON compatible object:
LOCAL oCustomer
oCustomer = JSONObject()
oCustomer.Add("id","0001")
oCustomer.Add("Name", "JOHN SMITH")
cCustomer = oCustomer.ToJSON()

For further uses please refer to the documentation and examples in QDFOXJSON.PRG.

Last edited May 27, 2014 at 3:05 PM by vespina, version 1

Comments

thesuhu Jun 28, 2014 at 5:06 PM 
Thank You