Главная страница
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.028 c
14-1084534455
Style
2004-05-14 15:34
2004.05.30
Какая то беда с Windows.SetTimer


7-1082619506
Pontic
2004-04-22 11:38
2004.05.30
Блокировка управления


6-1081634875
OrbitAl
2004-04-11 02:07
2004.05.30
Простенький LAN-чат


3-1084362734
SergeyM
2004-05-12 15:52
2004.05.30
ADOConnection.


3-1084016146
Nazer
2004-05-08 15:35
2004.05.30
Не могу создать индекс