Sample code for 30+ languages & platforms
Delphi ActiveX

Transition from Crypt2.LastJsonData to Crypt2.GetLastJsonData

Provides instructions for replacing deprecated LastJsonData method calls with GetLastJsonData.

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
success: Integer;
crypt2: TChilkatCrypt2;
jsonObj: IChilkatJsonObject;
jsonOut: TChilkatJsonObject;

begin
success := 0;

crypt2 := TChilkatCrypt2.Create(Self);

// ...
// ...

// ------------------------------------------------------------------------
// The LastJsonData method is deprecated:

jsonObj := crypt2.LastJsonData();
if (crypt2.LastMethodSuccess = 0) then
  begin
    Memo1.Lines.Add(crypt2.LastErrorText);
    Exit;
  end;

// ...
// ...

// ------------------------------------------------------------------------
// Do the equivalent using GetLastJsonData.
// Your application creates a new, empty JsonObject object which is passed 
// in the last argument and filled upon success.

jsonOut := TChilkatJsonObject.Create(Self);
crypt2.GetLastJsonData(jsonOut.ControlInterface);
if (success = 0) then
  begin
    Memo1.Lines.Add(crypt2.LastErrorText);
    Exit;
  end;
end;