unit BeiepielUnit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, uArrayBeispielUnit;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
FItemList: TItemList;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
FItemList:= TItemList.Create;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FItemList.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Item: TItem;
I: integer;
begin
FItemList.Clear;
for I:= 1
to 3
do
begin
Item.X:= '
X.'+IntToStr(3-I);
Item.X1:= '
X1.'+IntToStr(3-I);
Item.X2:= '
X2.'+IntToStr(3-I);
Item.X11:= '
X11.'+IntToStr(3-I);
Item.X12:= '
X12.'+IntToStr(3-I);
Item.X21:= '
X21.'+IntToStr(3-I);
Item.X22:= '
X22.'+IntToStr(3-I);
FItemList.AddItem(Item);
end;
for I:= 0
to FItemList.Count-1
do
ShowMessage(FItemList[I].X);
FItemList.Sort;
for I:= 0
to FItemList.Count-1
do
ShowMessage(FItemList[I].X);
end;
end.