Pascal (Lazarus/Delphi)
Pascal (Lazarus/Delphi)
.Z File Compression
See more Zip Examples
Use LZW compression to create a .Z compressed file. Compresses any single file into a .Z format compressed file.(Chilkat's .Z compression functionality is included as part of the Chilkat Zip license.)
Chilkat Pascal (Lazarus/Delphi) Downloads
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.UnixCompress;
// ---------------------------------------------------------------------------
procedure RunDemo;
var
success: Boolean;
uc: TUnixCompress;
begin
success := False;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
uc := TUnixCompress.Create;
success := uc.CompressFile('hamlet.xml','hamlet.xml.Z');
if (success <> True) then
begin
WriteLn(uc.LastErrorText);
end
else
begin
WriteLn('Success.');
end;
uc.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.