Hi,
eine Anmerkung bzw. Frage zu diesen Beitrag in der Code-Library:
https://www.delphipraxis.net/20262-m...inglisten.html
Müsste diese Funktion
Delphi-Quellcode:
procedure DifferenceStrings(const a, b, diff: TStrings);
var
i, idx : Integer;
begin
Assert(Assigned(a));
Assert(Assigned(b));
Assert(Assigned(diff));
diff.BeginUpdate;
try
diff.Assign(a);
for i := 0 to b.Count -1 do
begin
idx := diff.IndexOf(b.Strings[i]);
if idx >= 0 then
diff.Delete(idx);
end;
finally
diff.EndUpdate;
end;
end;
Nicht korrekterweiße so aussehen?
Delphi-Quellcode:
procedure DifferenceStrings(const a, b, diff: TStrings);
var
i, idx : Integer;
begin
Assert(Assigned(a));
Assert(Assigned(b));
Assert(Assigned(diff));
diff.BeginUpdate;
try
diff.Assign(a);
for i := 0 to b.Count -1 do
begin
idx := diff.IndexOf(b.Strings[i]);
if (idx >= 0) and (i < idx) then begin
diff.Delete(idx);
end;
end;
finally
diff.EndUpdate;
end;
end;
LG