CObList::Find

POSITION Find( CObject* searchValue, POSITION startAfter = NULL ) const;

Return Value

A POSITION value that can be used for iteration or object pointer retrieval; NULL if the object is not found.

Parameters

searchValue

The object pointer to be found in this list.

startAfter

The start position for the search.

Remarks

Searches the list sequentially to find the first CObject pointer matching the specified CObject pointer. Note that the pointer values are compared, not the contents of the objects.

Example

See CObList::CObList for a listing of the CAge class.

CObList list;
CAge* pa1;
CAge* pa2;
POSITION pos;
list.AddHead( pa1 = new CAge( 21 ) );
list.AddHead( pa2 = new CAge( 40 ) );    // List now contains (40, 21).
if( ( pos = list.Find( pa1 ) ) != NULL ) // Hunt for pa1
{                                        // starting at head by default.
    ASSERT( *(CAge*) list.GetAt( pos ) == CAge( 21 ) );
}

CObList OverviewClass MembersHierarchy Chart

See Also   CObList::GetNext, CObList::GetPrev