[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'Classes' (#rtl)

TStringList.Add

Implements the TStrings.Addfunction.

Declaration

Source position: classesh.inc line 566

public function TStringList.Add(

  const S: String

):Integer; override;

Description

Addwill add Sto the list. If the list is sorted and the string Sis already present in the list and TStringList.Duplicatesis dupErrorthen an EStringListErrorexception is raised. If Duplicatesis set to dupIgnorethen the return value is underfined.

If the list is sorted, new strings will not necessarily be added to the end of the list, rather they will be inserted at their alphabetical position.

Errors

If the list is sorted and the string Sis already present in the list and TStringList.Duplicatesis dupErrorthen an EStringListErrorexception is raised.

See also

TStringList.Insert

  

Overrides the TStrings.Insertmethod.

TStringList.Duplicates

  

Describes the behaviour of a sorted list with respect to duplicate strings.