Вниз
Скачать: 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.026 c
1-1084361111
новичок_из_сыктывкара
2004-05-12 15:25
2004.05.30
строку наоборот


1-1084544500
ruslan
2004-05-14 18:21
2004.05.30
delphi Timage


14-1083752201
Vlad Oshin
2004-05-05 14:16
2004.05.30
Логические задачи в среду :)


3-1084275020
Gennadiy
2004-05-11 15:30
2004.05.30
Проблема с условием в хранимой процедуре


14-1084214136
PaRL
2004-05-10 22:35
2004.05.30
Самообразование




   Наверх