Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.05.30;
Скачать: 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 вся ветка

Текущий архив: 2004.05.30;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.035 c
1-1084879268
62mkv
2004-05-18 15:21
2004.05.30
Exception + Raise = ????


11-1074712103
mike.dld
2004-01-21 22:08
2004.05.30
СиБилдер


1-1084722598
G_U_N
2004-05-16 19:49
2004.05.30
Объект


4-1081879825
AndersoNRules
2004-04-13 22:10
2004.05.30
Trouble s WM_ENDSESSION. ne vizivaezza prozzedura


9-1075751438
mx
2004-02-02 22:50
2004.05.30
скролл фона.