Вниз
Скачать: 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.028 c
1-1084606165
Alek_1
2004-05-15 11:29
2004.05.30
Форма в Dll


6-1082008631
malamba
2004-04-15 09:57
2004.05.30
работа с FTP при помощи IdFTP (Indy)- где бы почитать


14-1084345908
Mike Kouzmine
2004-05-12 11:11
2004.05.30
Эстония согласна простить Россию,


9-1074633038
Alex Storm
2004-01-21 00:10
2004.05.30
Создание ландшафта на GLScene


1-1084826769
Nk
2004-05-18 00:46
2004.05.30
Конвертация типов данных при вызове сишных DLL




   Наверх