Вниз
Скачать: 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.03 c
9-1075380883
Black Fury
2004-01-29 15:54
2004.05.30
Проблема с вызовом процедуры из *.dll


3-1084035092
Alleum
2004-05-08 20:51
2004.05.30
Программно добавить столбец


4-1081716403
pohil
2004-04-12 00:46
2004.05.30
Привилегии


14-1084386179
lak
2004-05-12 22:22
2004.05.30
задача


14-1083852088
clickmaker
2004-05-06 18:01
2004.05.30
мертвый код?




   Наверх