(VBScript) AppendArrayItems Example
Demonstrates the AppendArrayItems function.
Note: This example requires Chilkat v9.5.0.82 or above.
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.JsonArray")
set jarr1 = CreateObject("Chilkat.JsonArray")
success = jarr1.Load("[ 1, 2, 3, 4]")
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.JsonArray")
set jarr2 = CreateObject("Chilkat.JsonArray")
success = jarr2.Load("[ 5, 6, 7, 8]")
success = jarr1.AppendArrayItems(jarr2)
outFile.WriteLine(jarr1.Emit())
' Expected output: [1,2,3,4,5,6,7,8]
outFile.WriteLine(jarr2.Emit())
' Expected output: [5,6,7,8]
outFile.Close
|