Hallo, hab ein Problem (sowas aber auch^^).
Ich bekomme bei nem Vergleich zweier Listboxen bei Befund gleicher Einträge einen neuen Eintrag in ner 3. Listbox. Aber es wird immer das erste Zeichen gelöscht in meiner 3. Listbox. Warum?
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
| procedure TForm1.Button2Click(Sender: TObject); var count_i : Integer;
begin count_i := 0; repeat if Pos(LeftStr(Listbox1.Items.ValueFromIndex[count_i],12),ListBox2.Items.Text) = 0 then begin Listbox3.Items.Add(Listbox1.Items.ValueFromIndex[count_i]); end else begin Listbox4.Items.Add(Listbox1.Items.ValueFromIndex[count_i]); end; ListBox4.Items.Delete(ListBox4.Items.IndexOf('rei')); count_i := count_i + 1; until (count_i = count_l1); count_l3 := Listbox3.Items.Count; count_l4 := Listbox4.Items.Count; Label9.Caption := 'Einträge: ' + IntToStr(count_l3); Label10.Caption := 'Einträge: ' + IntToStr(count_l4); end; |