TLocateOption
TLocateOption = (loCaseInsensitive, loPartialKey)
Example
procedure FindCustomer(DataSet: TDataSet; var Found: Boolean);
begin
Found := DataSet.Locate(
'CustomerCode',
'ABC',
[loCaseInsensitive, loPartialKey]);
end;
Usage
TLocateOption defines case-insensitive and partial-key matching options for a dataset Locate operation.
Members
| Value | Ordinal | Meaning |
|---|---|---|
loCaseInsensitive | 0 | Compare supported key text without case significance. |
loPartialKey | 1 | Permit a prefix match on the final supported text key. |
Behavior and boundaries
- In the Velox client-dataset handling, partial matching appends a wildcard only to the final key field and only when that field is a string, fixed char, wide string, GUID or fixed wide char.
- Case-insensitive matching is passed into the client-dataset filter expression. Collation and Unicode behavior are Velox-specific, not a culture-independent text contract.
- Multiple key fields use a Variant array whose order must match the semicolon-separated
KeyFields. A scalar is accepted only for one key field. - Null key values generate
IS NULL; unsupported field kinds raise a bad-field-type database error. - The client search starts at BOF and chooses the first filter match.
BeforeScrollruns for every attempt; a successful locate moves/resynchronizes the visible cursor and invokesAfterScroll. - Locate enters browse mode before searching and can therefore finish pending edit/insert state. Treat it as state-changing, and do not use it concurrently on a shared dataset.
TvxClientDataSet.Findalways supplies[loCaseInsensitive]; useLocatedirectly when partial or exact case-sensitive behavior is required.
Additional Technical Info
TLocateOption is the element type of TLocateOptions, the set passed to a dataset's Locate method. Pass [] for exact, case-sensitive matching or combine the named options in a set.
Velox's modified base TDataSet.Locate returns false; concrete dataset classes implement the search. Because the imported method is virtual, PascalScript dispatches to the actual dataset class. The exact treatment of options is therefore provider-dependent.
External references
- Embarcadero TLocateOption - Delphi option meanings.
- Free Pascal TLocateOption - compatible Locate option behavior.
- Free Pascal TDataSet.Locate - key and cursor semantics.
- Embarcadero enumerated types - Delphi ordinal semantics.
- Free Pascal ordinal types - compatible enumeration concepts.