System.Classes.TStrings.AddObject

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function AddObject(const S: string; AObject: TObject): Integer; virtual;

C++

virtual int __fastcall AddObject(const System::UnicodeString S, System::TObject* AObject);

Properties

Type Visibility Source Unit Parent
function public
System.Classes.pas
System.Classes.hpp
System.Classes TStrings

Description

Adds a string to the list, and associates an object with the string.

Call AddObject to add a string and its associated object to the list. AddObject returns the index of the new string and object.

Note: The TStrings object does not own the objects you add this way. Objects added to the TStrings object still exist even if the TStrings instance is destroyed. They must be explicitly destroyed by the application.

See Also

Code Examples