Sign in Join
FPDoc Onlineexperiment

TBookmarkList.Find function

Member of TBookmarkListpublicIn unit DBGrids

Find locates the specified Bookmark and its position in the bookmark list.

Declaration

pascal
function Find(const Item: TBookmark; var AIndex: Integer): Boolean

Arguments

Item

Bookmark to locate.

AIndex

Position in the list for the bookmark.

Function result

True when the bookmark is located in the list.

Description

Find is a Boolean function used to locate the bookmark specified in Item in the Items for the bookmark list. No actions are performed in the method, and the return value is False, when a TBookmark instance has not been assigned to Item.

For datasets where the bookmark contains an index value, a binary search is used to locate the bookmark in Items. For other datasets, like TSQLQuery and TBufDataset, each bookmark in Items is visited to compare the values.

Find calls the TDataset.CompareBookmarks method to compare the value in Item to the bookmarks in Items. AIndex is set to the position in Items where the bookmark was located. The return value is True when the specified bookmark is located in the bookmark list.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.