OK, bin halt eher unskilled, habs jetzt aber, zumindest funktionierts
Delphi-Quellcode:
function test(const First, Second: TFilename; out stringL: TStringlist): Boolean;
var
s1, s2: TStringlist;
i: integer;
begin
Result := FileExists(First) and FileExists(Second);
if Result then
begin
s1 := TStringlist.Create;
try
s1.LoadFromFile(First);
s2 := TStringlist.Create;
try
s2.LoadFromFile(Second);
i := 0;
while (i < s1.Count) and (i < s2.Count) do
begin
Result := s1[i] = s2[i];
if not Result then
begin
stringL.Add(s1[i]);
//i := s1.Count;
end;
inc(i);
end;
finally
s2.Free;
end;
finally
s1.Free;
end;
end;
end;
aufruf:
Delphi-Quellcode:
try
sl := TStringlist.Create;
test_functions.test('C:\software.txt','C:\software2.txt',sl);
Writeln(sl.Text);
finally
sl.Free;
end;
Könnte man hier etwas aussetzen ?
LG