EasyTable: Single-File Embedded BDE Replacement
Database for Delphi and C++Builder
Moves the cursor to the record that most closely matches a specified set of key values.
procedure FindNearest(const KeyValues: array of const);
Call FindNearest to move the cursor to a specific record in a dataset or to the first record in the dataset that is greater than the values specified in the KeyValues parameter. KeyValues contains a comma-delimited array of field values, called a key. Each value in the key can be a literal, a variable, a null, or nil. If the number of values passed in KeyValues is less than the number of columns in the index used for the search, the missing values are assumed to be null.
The key must always be an index, which can be specified in the IndexName property. If IndexName is empty, FindNearest uses the table's primary index.
FindNearest positions the cursor either on a record that exactly matches the search criteria, or on the first record whose values are greater than those specified in the search criteria. KeyExclusive affects the boundary conditions of ranges and will affect the record selected by FindNearest.