Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Delphi DLL) JSON Append String ArrayDemonstrates 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
uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, JsonObject, StringTable; ... procedure TForm1.Button1Click(Sender: TObject); var json: HCkJsonObject; st: HCkStringTable; begin json := CkJsonObject_Create(); CkJsonObject_putEmitCompact(json,False); CkJsonObject_AppendString(json,'abc','123'); st := CkStringTable_Create(); CkStringTable_Append(st,'a'); CkStringTable_Append(st,'b'); CkStringTable_Append(st,'c'); CkStringTable_Append(st,'d'); CkJsonObject_AppendStringArray(json,'strArray',st); Memo1.Lines.Add(CkJsonObject__emit(json)); // Output: // { // "abc": "123", // "strArray": [ // "a", // "b", // "c", // "d" // ] // } CkJsonObject_Dispose(json); CkStringTable_Dispose(st); end; |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.