|
|
|
| acStringListContainer component.
|
| function Add(const S: String): Integer;
|
| The Add method adds a new string to the list.
|
|
|
| Call Add to add the string S to the end of the list. If the list is not sorted, S is added to the end of the list. Add returns the position of the item in the list, where the first item in the list has a value of 0.
|
|
|
|
|
|
|
| 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;
|
| Insert and AddStrings methods;
|
| Duplicates and MaxSize properties;
|
| OnChange event.
|