Lazarus Pascal
Lazarus Pascal
Example: Crypt2.CrcFile method
Demonstrates how to call the CrcFile method.Chilkat Lazarus Pascal 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.Crypt2;
// ---------------------------------------------------------------------------
procedure RunDemo;
var
crypt: TCrypt2;
filePath: string;
crc32: LongWord;
crc8: LongWord;
begin
crypt := TCrypt2.Create;
filePath := 'c:/temp/someFile.dat';
crc32 := crypt.CrcFile('crc-32',filePath);
WriteLn(crc32);
crc8 := crypt.CrcFile('crc8',filePath);
WriteLn(crc8);
crypt.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.