[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Get or set the current cursor position
Source position: db.pas line 1669
public property TDataSet.Bookmark : TBookMark |
Bookmark can be read to obtain a bookmark to the current position in the dataset. The obtained value can be used to return to current position at a later stage. Writing the Bookmark property with a value previously obtained like this, will reposition the dataset on the same position as it was when the property was read.
This is often used when scanning all records, like this:
Var B : TBookmarkStr; begin With MyDataset do begin B:=Bookmark; DisableControls; try First; While Not EOF do begin DoSomething; Next; end; finally EnableControls; Bookmark:=B; end; end;
At the end of this code, the dataset will be positioned on the same record as when the code was started. The TDataset.DisableControls and TDataset.EnableControls calls prevent the controls from receiving update notifications as the dataset scrolls through the records, tus recuding flicker on the screen.
Note that bookmarks become invalid as soon as the dataset closes. A call to refresh may also destroy the bookmarks.
|
Disable event propagation of controls |
|
|
Enable event propagation of controls |