Add items to a TString without duplicates  

Send By: Q3 Team
Web : www.q3.nu
Email: dlib@q3.nu
Date: 15/01/00

Tip accessed 579 times

 


It is easy using the IndexOf method:


 var
   Cadena:string

  Cadena:='Item a aņadir';
  with ComboBox1.Items do
      if IndexOf(Cadena) = - 1 then
        AddString(Cadena);




The example code uses a ComboBox, but is valid for another TStrings: ListBox1.Items, Memo1.lines, etc.