[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'DBGrids' (#lcl)

# TBookmarkList.Find

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

## Declaration

Source position: dbgrids.pas line 177

`public function TBookmarkList.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

TBookmarkList.Items |  | Provides indexed access to Bookmarks in the list.
TBookmark
TDataset.CompareBookmarks