To serialize simple values:
ltToday = DateTime() loSerializer = CREATEOBJECT("wwJsonSerializer") lcJSON = loSerializer.Serialize(ltToday)
To serialize an object:
*** Serialize an object (single or nested hierarchy) SELECT Customer SCATTER NAME loCustomer lcJSON=loSerializer.Serialize(loCustomer)
Cursors serialize like an array of object with a root node call Rows and an array of each row as an object.
Since cursors cannot be passed as a value to the Serialize() function special syntax is used:
cursor:<AliasName>
To serialize a FoxPro cursor or table:
select * from tt_cust into TCustomers loSerializer = CREATEOBJECT("wwJsonSerializer") lcJSON = loSerializer.Serialize("cursor:TCustomers")
o.Serialize(lvValue)