var i, cnt: integer; begin i:= 0; cnt := i; with Listbox1.Items do while Count > i do begin if IndexOf( strings[i] )<>i then begin Delete( i ) inc(cnt) end else inc( i ); ListBox1.ItemIndex := i; end; edit1.text := strtoint(cnt); end;