Autor Beitrag
Sauger Chris
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 228

Win XP, Linux SuSE 9.2
Delphi 4,Delphi 7 Ent.
BeitragVerfasst: Sa 10.12.05 16:15 
hiho hab mal wieder n problem

wie mach ich das das alle doppelten listbox items gelöscht werden
und das noch ne message kommt wieviele items doppelt waren

ps. hab nur eine listbox komponente


MfG sauger chris
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 10.12.05 16:47 
sortiere sie doch mit sorted := true war das glaube ich und dann guckst du, ob zwei hintereinander gleich sind. wenn du sie nicht sortieren willst, brauchst du eben eine schleife pro eintrag, also 2 schleifen in einer verschachtelung, ungefähr so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
for i := 0 to listbox1.items.count do
  for j := 0 do listbox1.items.count do
    if listbox1.lines[i] = listbox1.lines[j] then
      showmessages('Doppelter Eintrag gefunden!');
Sauger Chris Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 228

Win XP, Linux SuSE 9.2
Delphi 4,Delphi 7 Ent.
BeitragVerfasst: Sa 10.12.05 17:55 
thx aber geht es etwas genauer also mit nem quell text der auch functioniert
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 10.12.05 17:57 
jetzt wo du das prinzip kennst, solltest du es eigentlich allein hinbekommen, ansonsten verweise ich auch nocheinmal gerne auf das anfänger tutorial von Christian S. wenn du möchtest ;)