Вниз
Скачать: 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.02 c
14-1083616673
Sanek_metaller
2004-05-04 00:37
2004.05.30
Дизайн Сайта


1-1084967551
infom
2004-05-19 15:52
2004.05.30
Может кто встречал такое дополнение к Delphi


6-1081753570
Darkman
2004-04-12 11:06
2004.05.30
Как создать VPN соединение


7-1082715005
Rext
2004-04-23 14:10
2004.05.30
Доступ к принтеру


3-1083650137
TankMan
2004-05-04 09:55
2004.05.30
Что делать со скроллингом в DBGrid




   Наверх