Вниз
Скачать: 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
8-1080216881
nomshar
2004-03-25 15:14
2004.05.30
Апросксимация функций кривых


1-1084888831
ПрогерШу
2004-05-18 18:00
2004.05.30
Как изменить значение структуры по ссылке?


1-1084745029
killer
2004-05-17 02:03
2004.05.30
XPManifest и Panel


14-1084340647
Vitas2
2004-05-12 09:44
2004.05.30
ShareIt


14-1083939526
ИМХО
2004-05-07 18:18
2004.05.30
Что лучше: узкий специалист или дилетант с "широким" кругозором?




   Наверх