Bookmarking lazarus / 16-Databases ---------------------------------------------------------------------- fpcoder · 2017-05-16 19:40 According to the doc's, GetBookmark, GotoBookmark and so on is deprecated and TBookmarkStr should be used together with the datasets Bookmark property. https://www.freepascal.org/docs- html/fcl/db/tdataset.bookmark.html Are these errors because I use fpc 3.0 instead of 3.02 ? QuoteuMain.pas(54,22) Error: Incompatible types: got "TBytes" expected "AnsiString" uMain.pas(59,32) Error: Incompatible type for arg no. 1: Got "AnsiString", expected "TBytes" Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  bookmark: TBookmarkStr; procedure TForm1.btnSetBookmarkClick(Sender: TObject);begin  bookmark:= qryItems.Bookmark;end; procedure TForm1.btnGoToBookmarkClick(Sender: TObject);begin  qryItems.Bookmark := bookmark;end; ---------------------------------------------------------------------- valdir.marcos · 2017-05-16 21:10 First, take a look on this other thread (TBookmark or TBookmarkStr — the confusion, May 06, 2013): Quote from: Zoran on May 06, 2013, 11:52:43 amThe documentation claims that TBookmark is deprecated in favour of TBookmarkStr, but, in the source, TBookmarkStr is the type which is marked deprecated. The fpc 2.6.2 documentation (see: http://www.freepascal.org/docs- html/fcl/db/tbookmark.html) says that TBookmark is depracated: QuoteTBookmark Bookmark type (deprecated)Further on the same page, you can read (bold by me): QuoteTBookMark is the type used by the TDataset.SetBookMark method. It is an opaque type, and should not be used any more, it is superseded by the TBookmarkStr type. However, the source of db unit (fpc 2.6.2) claims quite opposite: Code: [Select]  TBookmark = Pointer;   TBookmarkStr = string deprecated 'TBookmarkStr will disappear in 2.6.3 in favour of TBookmark'; What is the actual status of these two types? Which one should be used? Quote from: marcov on May 06, 2013, 08:34:28 pmTBookmark will stay for sure since it is D2009+ compatible. Afaik this situation reflects the confusing situation with Delphi where first they steered people towards bookmarkstr (since string and thus managed), but that bit them when they changed the definition of the stringtype, and Embarcadero changed TBookmark to array of byte so that it was also autocleaned. Currently, FPC 2.6.x leans towards bookmarkstr (older Delphis) and 2.7.x (more D2009+ like) will do both. ---------------------------------------------------------------------- fpcoder · 2017-05-17 12:30 Hilarous.  TBookmark is the way to go then. ---------------------------------------------------------------------- GAN · 2017-05-17 21:24 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     for i:=0 to DBGrid1.SelectedRows.Count-1 do    with DBGrid1.DataSource.DataSet do    begin      GotoBookmark(pointer(DBGrid1.SelectedRows.Items[i]));       // do something    end; Hi @kapibara I use this and works fine, but really don't know if can help you.