Вниз
Скачать: CL | DM;

TList.Sort   Найти похожие ветки 

← →
Lera   (2004-05-17 11:32) [0]

Подскажите пожалуйста, как сортировать численный спиок в StringGrid с помощью TList.Sort по убыванию.Спасибо.


← →
[lamer]Barmaglot ©   (2004-05-17 11:54) [1]

Ну примерно так...


function TListSortCompare(Item1, Item2: Pointer): Integer;
begin
if integer(item1)>=integer(item2) then result:=0 else result:=1;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
 t:    TList;
 k:    integer;
begin
t:=TList.Create;
t.Add(@Form1);
t.Add(@button3);
t.Add(@button1);
t.Add(@button2);
t.Sort(TListSortCompare);

For k:=0 to t.Count-1 do
 listbox1.Items.Add(inttostr(Integer(t.Items[k])));

t.Destroy;
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.44 MB
Время: 0.022 c
3-1084420699
Fanta
2004-05-13 07:58
2004.05.30
ADO Access поля типа OLE-объект


6-1081684301
Leos
2004-04-11 15:51
2004.05.30
Proxy


1-1084361111
новичок_из_сыктывкара
2004-05-12 15:25
2004.05.30
строку наоборот


8-1079292951
Mixvictor
2004-03-14 22:35
2004.05.30
Пожирание памяти


1-1084775194
Sergo
2004-05-17 10:26
2004.05.30
TreeView




   Наверх