Xojo Plugin
Xojo Plugin
JSON AppendArray2 Example
Demonstrates the AppendArray2 function.Chilkat Xojo Plugin Downloads
Dim json As New Chilkat.JsonObject
Dim success As Boolean
success = json.Load("{ ""name"": ""John"", ""marbles"": 100 }")
// Append an empty array named "xyz"
Dim jarr As New Chilkat.JsonArray
success = json.AppendArray2("xyz",jarr)
System.DebugLog(json.Emit())
// Expected output is: {"name":"John","marbles":100,"xyz":[]}
// Add elements to the array.
success = jarr.AddStringAt(-1,"hello")
success = jarr.AddIntAt(-1,256)
System.DebugLog(json.Emit())
// Expected output is: {"name":"John","marbles":100,"xyz":["hello",256]}