stringlistcontainer AddStrings method
Return to Introduction  Previous page  Next page
Applies to
acStringListContainer component.  

Declaration
procedure AddStrings(Strings: TStrings);  

Description
The AddStrings method adds a group of strings to the list.  
 
Call AddStrings to add the strings from another TStrings object (or its successor) to the list. If both the source and destination TStrings objects support objects associated with their strings, references to the associated objects will be added as well.  

Example
procedure TForm1.FormCreate(Sender: TObject);  
var  
  MyList: TacStringList;  
  Index: Integer;  
begin  
  MyList := TacStringList.Create;  
  try  
    MyList.Add('Animals');  
    MyList.Add('Flowers');  
    MyList.Add('Cars');  
 
    if MyList.Find('Flowers', Index) then  
     begin  
      ListBox1.Items.AddStrings(MyList);  
      Label1.Caption := 'Flowers has an index value of ' + IntToStr(Index);  
     end;  
  finally  
    MyList.Free;  
  end;  
end;  

See also
Add and Insert methods;  
Duplicates property.