Вниз
Скачать: 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.041 c
4-1082100484
unknown_nik
2004-04-16 11:28
2004.05.30
Можно-ли разблокировать файл открытый другой программой?


14-1084529163
Dimman
2004-05-14 14:06
2004.05.30
Простой ворос


3-1083899885
garry79
2004-05-07 07:18
2004.05.30
Глюки IBDataSet, а может IBX в целом


14-1084092082
nikkie
2004-05-09 12:41
2004.05.30
Новая версия DMClient - 2.1.1


9-1075642088
Vertex
2004-02-01 16:28
2004.05.30
За стеклом




   Наверх