RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TTable.GotoKey Method

Moves the cursor to a record specified by the current key.

Pascal
function GotoKey: Boolean;
C++
__fastcall Boolean GotoKey();

Use GotoKey to move to a record specified by key values assigned with previous calls to SetKey or EditKey and actual search values indicated in the Fields property. 

If GotoKey finds a matching record, it positions the cursor on the record and returns true. Otherwise the current cursor position remains unchanged, and GotoKey returns false. 

For Paradox and dBASE tables, the key must always be an index, which can be specified in the IndexName property. If IndexName is empty, GotoKey uses the table's primary index. GotoKey works with dBASE expression indexes. 

For SQL tables, the key may correspond to a specified index in IndexName, or to a list of field names in the IndexFieldNames property. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!