|
حذف داده هاي تکراري از ليست
Procedure RemoveDuplicateItem(SrcList,DestList:TStringList);
var
i:cardinal;
index:longint;
str:string;
begin
If not assigned(SrcList) then
SrcList := TStringList.Create;
If not assigned(DestList) then
DestList := TStringList.Create;
SrcList.Sort;
for i:=0 to SrcList.Count-1 do begin
str:=SrcList.Strings[i];
DestList.Sort;
index:=0;
If not DestList.Find(str,index) then begin
DestList.Insert(index,str);
end;
end;
end;
| |
|