unit MainForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,
SortObjectListUnit;
type
TForm1 = class(TForm)
Memo1: TMemo; { TMemo1 enthält sechs Zeilen mit je einem Wort }
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
function CompareTest(AItem, BItem: TMyItem): Integer;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var A : TTestList;
j : Integer;
function MakeTestItem(AString: String): TMyItem;
begin Result := TMyItem.Create; Result.Dummy := AString; end;
// auf diese Leerzeile zeigt "F2084 Interner Fehler: URW1111"
begin
A := TTestList.Create(True);
for j := 0 to Pred(Memo1.Lines.Count) do A.Add(MakeTestItem(Memo1.Lines[j]));
A.QuickSort(0, Pred(A.Count), CompareTest);
Memo1.Clear;
for j := 0 to Pred(A.Count) do Memo1.Lines.Add(A[j].Dummy);
A.Free;
end;
function TForm1.CompareTest(AItem, BItem: TMyItem): Integer;
begin
Result := CompareStr(AItem.Dummy, BItem.Dummy);
end;
end.