System.WideStrings.TWideStringList.Add

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Add(const S: WideString): Integer; override;

C++

virtual int __fastcall Add(const System::WideString S);

Properties

Type Visibility Source Unit Parent
function public
System.WideStrings.pas
System.WideStrings.hpp
System.WideStrings TWideStringList

Description

Adds a new string to the list.

Call Add to add the string S to the list. If the list is sorted, S is added to the appropriate position in the sort order. 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.

Note: For sorted lists, Add will raise an EListError exception if the string S already appears in the list and Duplicates is set to dupError. If Duplicates is set to dupIgnore, trying to add a duplicate string causes Add to return the index of the existing entry.

See Also