Вниз
Скачать: 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.021 c
3-1083503801
Arximed
2004-05-02 17:16
2004.05.30
Удаление записей


1-1084630778
festu
2004-05-15 18:19
2004.05.30
как узнать, открыта форма или нет?


3-1083780956
TrOnIc
2004-05-05 22:15
2004.05.30
Подсчет .T. и . F. в таблице


9-1074453881
Jenea
2004-01-18 22:24
2004.05.30
Игра гонка. как зделать сталкновение


14-1084042210
Shopot
2004-05-08 22:50
2004.05.30
Динамический объект.




   Наверх