Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxFastList.Extract(Pointer,TdxListDirection) Method

Removes the specified stored pointer and returns it.

#Declaration

Delphi
function Extract(AItem: Pointer; ADirection: TdxListDirection = ldFromBeginning): Pointer;

#Parameters

Name Type
AItem Pointer
ADirection TdxListDirection

#Returns

Type
Pointer

#Remarks

Call this function and pass a pointer as the AItem parameter to remove the pointer from the ordered pointer list. Pass ldFromEnd as the optional ADirection parameter to reverse the default search direction, which can be useful if the list is sorted. If the list contains the specified pointer, the Extract function:

  • Removes the pointer from the list.

  • Returns the removed pointer.

  • Decrements the Count property value by one.

  • Shifts any remaining pointers at the end of the original list by one position towards the list’s beginning.

Otherwise, the Extract function returns nil (in Delphi) or NULL/nullptr (in C++Builder).

Note

The Extract function calls the IndexOf function internally to search the specified pointer. Call The ExtractByIndex function instead if you need to extract a stored pointer by its known position (that is, the index) within the list.

See Also