VBScript
VBScript
Create JSON Array of Strings
See more JSON Examples
Demonstrates how to create a JSON array of strings.Chilkat VBScript Downloads
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' The goal of this example is to produce this:
' [
' "tag1",
' "tag2",
' "tag3"
' ]
set jarr = CreateObject("Chilkat.JsonArray")
success = jarr.AddStringAt(-1,"tag1")
success = jarr.AddStringAt(-1,"tag2")
success = jarr.AddStringAt(-1,"tag3")
jarr.EmitCompact = 0
outFile.WriteLine(jarr.Emit())
outFile.Close