Вниз
Скачать: 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
1-1084654146
saNat
2004-05-16 00:49
2004.05.30
CGI приложение.


14-1084444084
Lera
2004-05-13 14:28
2004.05.30
Ребята, подскажите как из приложения вызвать другой EXE файл


14-1084264874
slaga
2004-05-11 12:41
2004.05.30
] Я вот хочу начать изучать COM технологию, хотел спросить может


1-1084809743
Heet
2004-05-17 20:02
2004.05.30
Ошибка совместного доступа к файлу


14-1084350738
xman
2004-05-12 12:32
2004.05.30
Install Shield EXPRESS




   Наверх