Sample code for 30+ languages & platforms
VBScript Requires Chilkat v11.4.0+

Example: JsonObject.NewArrayOf method

See more JSON Examples

Demonstrates the NewArrayOf method.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

success = 0

big_cats = "[""lion"",""tiger"",""leopard"",""jaguar"",""cheetah"",""snow leopard"",""clouded leopard"",""cougar"",""puma"",""panther""]"

set json = CreateObject("Chilkat.JsonObject")

success = json.UpdateString("test","abc")

success = json.NewArrayOf("big_cats",big_cats)
If (success = 0) Then
    outFile.WriteLine(json.LastErrorText)
    WScript.Quit
End If

json.EmitCompact = 0
outFile.WriteLine(json.Emit())

'  Result:

'  {
'    "test": "abc",
'    "big_cats": [
'      "lion",
'      "tiger",
'      "leopard",
'      "jaguar",
'      "cheetah",
'      "snow leopard",
'      "clouded leopard",
'      "cougar",
'      "puma",
'      "panther"
'    ]
'  }

outFile.Close