function AddObject(const S: string; const AObject: TObject): Integer; overload;
Adds S with the object AObject, as Add.
| # | Name | Description |
|---|---|---|
| 1 | S | The text, every text kind; it may be an item of this list. |
| 2 | AObject | The item's object; with OwnsObjects the list frees it. |
Returns: Integer - The new item's index.
Examples
An item with its object.
uses Substr;
procedure Example;
var List: TSubstringList;
begin
List := TSubstringList.Create(4);
try
List.AddObject('self', List);
Assert(List.Objects[0] = List);
finally
List.Free;
end;
end;