Skip to content

TStrings.AddPair

Add a name-value pair.

Declaration

Source position: classesh.inc line 1104

public 
function AddPair(const AName: string; const AValue: string) : TStrings
                ;  overload; overload;

function AddPair(const AName: string; const AValue: string; 
                AObject: TObject) : TStrings;  overload; overload;

Description

AddPair adds a Name=Value pair with the AName and AValue parameters, optionally with object AObject. It uses the correct NameValueSeparator character to do so.

AddPair does not test whether aName already exists, so it is possible to add duplicate names.

Errors

None.

See also

Name Description
TStrings.GetNameValue Return both name and value of a name,value pair based on it's index.
TStrings.NameValueSeparator Value of the character used to separate name,value pairs.
TStrings.Add Add a string to the list.
TStrings.AddObject Add a string and associated object to the list.