SortTStrings - Fehlermeldung

Wenn ich folgende Prozedur ...
Code:
procedure SortTStrings(Strings:TStrings; Duplicates:TDuplicates);
var
  tmp: TStringList;
begin
  Assert(Assigned(Strings), 'SortTStrings: invalid arg');
  if Strings is TStringList then
  begin
    TStringList(Strings).Duplicates := Duplicates;
    TStringList(Strings).Sort;
  end else
  begin
    tmp := TStringList.Create;
    try
      tmp.Duplicates := Duplicates;
      tmp.Sorted := True;

      // make a sorted copy
      tmp.Assign(Strings);
      // copy back
      Strings.Assign(tmp);
    finally
      tmp.Free;
    end;
  end;
end;
... mit ...
Code:
SortTStrings(Form1.Memo1.Lines,[dupIgnore]);
...aufrufe, erhalte ich folgende Fehlermeldung...
Code:
[Fehler] Unit1.pas(75): Inkompatible Typen: 'TDuplicates' und 'Set'
...und ich hab keine Ahnung,weshalb ^^ Jemand einen Hinweis?

PS: Tipp ist von DP
 
Hab trotzdem etwas:

Ruf es so auf, dann funktioniert es. Hab's ausprobiert.
Code:
SortTStrings(Form1.Memo1.Lines, dupIgnore);

MArc
 

Neue Beiträge

Zurück