Sample code for 30+ languages & platforms
VBScript

JSON Append String Array

See more JSON Examples

Demonstrates how to append an array of strings from a string table object.

Note: This example uses the AppendStringTable method, which was introduced in Chilkat v9.5.0.67

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)

set json = CreateObject("Chilkat.JsonObject")
json.EmitCompact = 0

success = json.AppendString("abc","123")

set st = CreateObject("Chilkat.StringTable")
success = st.Append("a")
success = st.Append("b")
success = st.Append("c")
success = st.Append("d")

success = json.AppendStringArray("strArray",st)

outFile.WriteLine(json.Emit())

' Output:

' 	{
' 	  "abc": "123",
' 	  "strArray": [
' 	    "a",
' 	    "b",
' 	    "c",
' 	    "d"
' 	  ]
' 	}

outFile.Close