1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| procedure TForm1.SuppDoublonsListView1;
var i,iEncours,iEncoursSearch:integer;
str : String;
strlist:TStringList;f : TextFile;
begin
i := 0;
strlist := TStringList.Create;//Assignfile(f,'C:\titi.txt');Rewrite(f);
while i <= ListView1.Items.Count -1 do
begin
str := uppernoaccent(ListView1.Items.Item[i].Caption+ListView1.Items.Item[i].SubItems.Strings[0]+ListView1.Items.Item[i].SubItems.Strings[1]+ListView1.Items.Item[i].SubItems.Strings[2]+ListView1.Items.Item[i].SubItems.Strings[3]+ListView1.Items.Item[i].SubItems.Strings[4]);
strlist.Add(str);
//write(f,inttostr(i)+' '+str+#13);
i := i+1;
end;
iEncoursSearch := strlist.Count -1;
while iEncoursSearch >= 0 do
begin
iEncours := iEncoursSearch;
while iEncours >=0 do
begin
if strlist.Strings[iEncours]=strlist.Strings[iEncoursSearch] then
ListView1.Items.Delete(iEncours);
dec(iEncours);
end;
dec(iEncoursSearch);
end;
strlist.Free;//CloseFile(f);
end; |
Partager