TSubstringList.Duplicates Property

property Duplicates: TDuplicates read FDuplicates write FDuplicates;

What a sorted list's Add does with a text equal to an item: dupIgnore, dupAccept or dupError.

Returns: TDuplicates

Examples

A duplicate ignored, then accepted.

uses Substr, System.Types;

procedure Example;
var List: TSubstringList;
begin
    List := TSubstringList.Create(4);
    try
        List.Sorted := True;
        List.Add('a');
        Assert((List.Add('a') = 0) and (List.Count = 1));
        List.Duplicates := dupAccept;
        List.Add('a');
        Assert(List.Count = 2);
    finally
        List.Free;
    end;
end;
See Also: TSubstringList.Sorted