Visual Basic 6.0
Visual Basic 6.0
Example: JsonObject.NewArrayOf method
See more JSON Examples
Demonstrates theNewArrayOf method.
Chilkat Visual Basic 6.0 Downloads
Dim success As Long
success = 0
Dim big_cats As String
big_cats = "[""lion"",""tiger"",""leopard"",""jaguar"",""cheetah"",""snow leopard"",""clouded leopard"",""cougar"",""puma"",""panther""]"
Dim json As New ChilkatJsonObject
success = json.UpdateString("test","abc")
success = json.NewArrayOf("big_cats",big_cats)
If (success = 0) Then
Debug.Print json.LastErrorText
Exit Sub
End If
json.EmitCompact = 0
Debug.Print json.Emit()
' Result:
' {
' "test": "abc",
' "big_cats": [
' "lion",
' "tiger",
' "leopard",
' "jaguar",
' "cheetah",
' "snow leopard",
' "clouded leopard",
' "cougar",
' "puma",
' "panther"
' ]
' }