Sample code for 30+ languages & platforms
Xojo Plugin

JSON AppendObject2 Example

Demonstrates the AppendObject2 function.

Chilkat Xojo Plugin Downloads

Xojo Plugin
Dim json As New Chilkat.JsonObject
Dim success As Boolean
success = json.Load("{ ""name"": ""John"", ""marbles"": 100 }")

// Append an empty object named "addr"
Dim jObj As New Chilkat.JsonObject
success = json.AppendObject2("addr",jObj)

System.DebugLog(json.Emit())
// Expected output is:   {"name":"John","marbles":100,"addr":{}}

// Add members to the object.
success = jObj.AppendString("street","1200 Elm St.")
success = jObj.AppendString("city","Springfield")
success = jObj.AppendInt("zip",60606)

System.DebugLog(json.Emit())
// Expected output is:  {"name":"John","marbles":100,"addr":{"street":"1200 Elm St.","city":"Springfield","zip":60606}}