Вниз
Скачать: 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
1-1084356739
BlackTiger
2004-05-12 14:12
2004.05.30
Как преобразовать "&#_1092;&#_1099;&#_1074;" в String.


11-1072781364
Vadim Petrov
2003-12-30 13:49
2004.05.30
XHelpgen и новаый KOL


4-1082564288
bOSE
2004-04-21 20:18
2004.05.30
завершение сеанса в w2k/xp


14-1084520263
Vlad Oshin
2004-05-14 11:37
2004.05.30
Что будет быстрее: сравнить две строки[255] или взять к.л.


14-1083988921
mfender
2004-05-08 08:02
2004.05.30
Безумцы!




   Наверх