Var iList, iRetry: Integer; tmpChecksum, tmpFile: String; tmpList: TStringList; tmpSuccess: Boolean; Const ctChecksumFile = 'C:\Test\Customer\Data\Checksum.txt'; Begin psExitCode:= 0; tmpChecksum := ''; tmpFile := psFilePath + psFileName; tmpSuccess := False; // ... add your code here tmpList := TStringList.Create; Try If FileExists(ctChecksumFile) Then Begin Try tmpList.LoadFromFile(ctChecksumFile); tmpSuccess := True; // psLogWrite(1, '', 'LoadFromFile ' + ctChecksumFile + ' Successfull'); Except psLogWrite(1, '', 'LoadFromFile exception of ' + ctChecksumFile); End; End; // If tmpSuccess Then Begin tmpChecksum := psGetFileChecksum(tmpFile, 1); // SHA256 If tmpChecksum <> '' Then Begin If Pos(psFileName, tmpList.Text) <> 0 Then Begin tmpSuccess := False; For iList := 0 to (tmpList.Count-1) Do Begin If Pos(psFileName + '|' + tmpChecksum + '|', tmpList.Strings[iList]) <> 0 Then Begin tmpSuccess := True; Break; End; End; // If tmpSuccess Then Begin psExitCode := 1; psLogWrite(1, '', 'Checksum of ' + tmpFile + ' available in ' + ctChecksumFile); End Else Begin psLogWrite(1, '', 'Error, checksum of ' + tmpFile + ' not available in ' + ctChecksumFile); psLogWrite(1, '', 'Error, check if content of ' + psFilename + ' was changed after it was moved to ' + psFilePath); End; End Else psLogWrite(1, '', 'Error, ' + tmpFile + ' not available in ' + ctChecksumFile); End Else psLogWrite(1, '', 'Error, could not calculate checksum of ' + ctChecksumFile); End Else psLogWrite(1, '', 'Error, could not load ' + ctChecksumFile); Finally tmpList.Free; End; End.