Sample code for 30+ languages & platforms
Pascal (Lazarus/Delphi)

Get Version of Chilkat

Demonstrate how to find out the version of Chilkat at runtime.

Chilkat Pascal (Lazarus/Delphi) Downloads

Pascal (Lazarus/Delphi)
program ChilkatDemo;

// Demonstrates using the Chilkat Pascal wrapper via the C bridge DLL.
// Builds as a console application under Lazarus (FPC) or Delphi.

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}
{$APPTYPE CONSOLE}

uses
  {$IFDEF UNIX}
  cthreads,
  {$ENDIF}
  SysUtils,
  CkDllLoader,
  Chilkat.SFtp,
  Chilkat.JsonObject;

// ---------------------------------------------------------------------------

procedure RunDemo;
var
  sftp: TSFtp;
  chilkatVersion: string;
  json: TJsonObject;

begin
  //  Most Chilkat classes include a Version property.
  //  To find the version of Chilkat, such as "9.5.0.94",
  //  instantiate the object and examine the Version property.

  //  For example:
  sftp := TSFtp.Create;
  chilkatVersion := sftp.Version;
  WriteLn(chilkatVersion);

  //  Most other Chilkat classes also have the Version property
  //  For example:
  json := TJsonObject.Create;
  WriteLn(json.Version);


  sftp.Free;
  json.Free;

end;

// ---------------------------------------------------------------------------

begin

  try
    RunDemo;
  except
    on E: Exception do
      WriteLn('Unhandled exception: ', E.ClassName, ': ', E.Message);
  end;

  WriteLn;
  {$IFDEF MSWINDOWS}
  WriteLn('Press Enter to exit...');
  ReadLn;
  {$ENDIF}
end.