RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TAbstractNamedVariants.IndexOfName Method

Returns the index of the first item in the list with a specified name.

Pascal
function IndexOfName(const Name: string): Integer; virtual;
C++
virtual __fastcall int IndexOfName(const AnsiString Name);

Call IndexOfName to determine where a name appears in the list, if it appears at all. 

Name is the name to locate in the list. 

If Name appears as the name part of a name/Variant pair in the list, IndexOfName returns the index of the first item with that name. If there are no items with the specified name, IndexOfName returns –1.

Note: In TAbstractNamedVariants, IndexOfName uses a case-insensitive comparison to locate the name. In descendant classes that treat strings case sensitively, IndexOfName makes a case sensitive comparison.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!