(DataFlex) AppendArrayItems Example
Demonstrates the AppendArrayItems function.
Note: This example requires Chilkat v9.5.0.82 or above.
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoJarr1
Boolean iSuccess
Variant vJarr2
Handle hoJarr2
String sTemp1
Get Create (RefClass(cComChilkatJsonArray)) To hoJarr1
If (Not(IsComObjectCreated(hoJarr1))) Begin
Send CreateComObject of hoJarr1
End
Get ComLoad Of hoJarr1 "[ 1, 2, 3, 4]" To iSuccess
Get Create (RefClass(cComChilkatJsonArray)) To hoJarr2
If (Not(IsComObjectCreated(hoJarr2))) Begin
Send CreateComObject of hoJarr2
End
Get ComLoad Of hoJarr2 "[ 5, 6, 7, 8]" To iSuccess
Get pvComObject of hoJarr2 to vJarr2
Get ComAppendArrayItems Of hoJarr1 vJarr2 To iSuccess
Get ComEmit Of hoJarr1 To sTemp1
Showln sTemp1
// Expected output: [1,2,3,4,5,6,7,8]
Get ComEmit Of hoJarr2 To sTemp1
Showln sTemp1
// Expected output: [5,6,7,8]
End_Procedure
|