
27.07.2012, 15:29
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
var
AStringList: TStringList;
function Compare(List: TStringList; Index1, Index2: Integer): Integer;
begin
if Integer(List.Objects[Index1])>Integer(List.Objects[Index2]) then Result:=1
else if Integer(List.Objects[Index1])<Integer(List.Objects[Index2]) then Result:=-1
else Result:=0;
end;
begin
AStringList:=TStringList.Create;
AStringList.AddObject('http://www.apple.com/', Pointer(50));
AStringList.AddObject('http://www.intorned.com/', Pointer(100));
AStringList.AddObject('http://www.microsoft.com/', Pointer(75));
AStringList.AddObject('http://www.ubuntu.com/', Pointer(25));
AStringList.CustomSort(@Compare);
Memo1.Lines.Assign(AStringList);
AStringList.Free;
end;
__________________
Пишу программы за еду.
__________________
|