Overload List
| # | Signature | Description |
|---|---|---|
| 1 | constructor Create; overload; | An empty list with Capacity 128. |
| 2 | constructor Create(const OwnsObjects: Boolean); overload; | An empty list with Capacity 128 that frees its items' objects when OwnsObjects is True. |
| 3 | constructor Create(const QuoteChar, Delimiter: Char); overload; | An empty list with Capacity 128, quoting with QuoteChar and delimiting with Delimiter. |
| 4 | constructor Create(const ACapacity: Integer); overload; | An empty list with room for ACapacity items, in steps of 128 rows, at least 128. |
| 5 | constructor Create(const Duplicates: TDuplicates; const Sorted: Boolean); overload; | An empty list with Capacity 128 and the given Duplicates and Sorted. |
Overload 1: constructor Create; overload;
An empty list with Capacity 128.
Result: stored in self (calling object)
Not sorted, Duplicates dupIgnore, comparing by code unit, owning no objects. It grows by itself; Capacity reserves more rows ahead.
Overload 2: constructor Create(const OwnsObjects: Boolean); overload;
An empty list with Capacity 128 that frees its items' objects when OwnsObjects is True.
| # | Name | Description |
|---|---|---|
| 1 | OwnsObjects | True: deleting an item, Clear and Free free its object. |
Result: stored in self (calling object)
Overload 3: constructor Create(const QuoteChar, Delimiter: Char); overload;
An empty list with Capacity 128, quoting with QuoteChar and delimiting with Delimiter.
| # | Name | Description |
|---|---|---|
| 1 | QuoteChar | The quote of DelimitedText. |
| 2 | Delimiter | The delimiter of DelimitedText. |
Result: stored in self (calling object)
Overload 4: constructor Create(const ACapacity: Integer); overload;
An empty list with room for ACapacity items, in steps of 128 rows, at least 128.
| # | Name | Description |
|---|---|---|
| 1 | ACapacity | The number of items to hold without growing; Capacity is it rounded up to a multiple of 128. |
Result: stored in self (calling object)
A list sized at creation.
uses Substr;
procedure Example;
var List: TSubstringList;
begin
List := TSubstringList.Create(1000);
try
Assert(List.Capacity = 1024);
Assert(List.Count = 0);
finally
List.Free;
end;
end;
Overload 5: constructor Create(const Duplicates: TDuplicates; const Sorted: Boolean); overload;
An empty list with Capacity 128 and the given Duplicates and Sorted.
| # | Name | Description |
|---|---|---|
| 1 | Duplicates | What a sorted list's Add does with a text equal to an item. |
| 2 | Sorted | Whether Add places each text at its sorted place. |
Result: stored in self (calling object)