RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TWideStringList.Add Method

Adds a new string to the list.

Pascal
function Add(const S: WideString): Integer; override;
C++
virtual __fastcall int Add(const BSTR S);

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.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!