Sample code for 30+ languages & platforms
Delphi ActiveX

Create JSON Array of Strings

See more JSON Examples

Demonstrates how to create a JSON array of strings.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;

...

procedure TForm1.Button1Click(Sender: TObject);
var
jarr: TChilkatJsonArray;

begin
// The goal of this example is to produce this:

// [
//   "tag1",
//   "tag2",
//   "tag3"
// ]

jarr := TChilkatJsonArray.Create(Self);
jarr.AddStringAt(-1,'tag1');
jarr.AddStringAt(-1,'tag2');
jarr.AddStringAt(-1,'tag3');

jarr.EmitCompact := 0;
Memo1.Lines.Add(jarr.Emit());
end;