Lianja
Lianja
Example: JsonObject.NewArrayOf method
See more JSON Examples
Demonstrates theNewArrayOf method.
Chilkat Lianja Downloads
llSuccess = .F.
lcBig_cats = '["lion","tiger","leopard","jaguar","cheetah","snow leopard","clouded leopard","cougar","puma","panther"]'
loJson = createobject("CkJsonObject")
loJson.UpdateString("test","abc")
llSuccess = loJson.NewArrayOf("big_cats",lcBig_cats)
if (llSuccess = .F.) then
? loJson.LastErrorText
release loJson
return
endif
loJson.EmitCompact = .F.
? loJson.Emit()
// Result:
// {
// "test": "abc",
// "big_cats": [
// "lion",
// "tiger",
// "leopard",
// "jaguar",
// "cheetah",
// "snow leopard",
// "clouded leopard",
// "cougar",
// "puma",
// "panther"
// ]
// }
release loJson