(Delphi DLL) AppendArrayItems Example
Demonstrates the AppendArrayItems function.
Note: This example requires Chilkat v9.5.0.82 or above.
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, JsonArray;
...
procedure TForm1.Button1Click(Sender: TObject);
var
jarr1: HCkJsonArray;
jarr2: HCkJsonArray;
begin
jarr1 := CkJsonArray_Create();
CkJsonArray_Load(jarr1,'[ 1, 2, 3, 4]');
jarr2 := CkJsonArray_Create();
CkJsonArray_Load(jarr2,'[ 5, 6, 7, 8]');
CkJsonArray_AppendArrayItems(jarr1,jarr2);
Memo1.Lines.Add(CkJsonArray__emit(jarr1));
// Expected output: [1,2,3,4,5,6,7,8]
Memo1.Lines.Add(CkJsonArray__emit(jarr2));
// Expected output: [5,6,7,8]
CkJsonArray_Dispose(jarr1);
CkJsonArray_Dispose(jarr2);
end;
|