Question : Delphi 2010 TList and TBookmark issue

Hello everyone,

I am trying to save a TBookmarks from a TTable into TList. But the problem is when I am trying to move to those TBookmark positions in the TTable. It does not position correctly. This used to work back in the older versions of Delphi but I need this for Delphi 2010. Test project is very simple. Form and two tables shown in two grids.

Kind regards
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
var BookmarkList: TList;

... ON CREATE BookmarkList := TList.Create;

// Feed Bookmarks to TList. You can add random record... just remember the order.
procedure TFormTest.ButtonAddBookmarkToListClick(Sender: TObject);
var TempBookmark: TBookmark;
begin
  TempBookmark := mySQLTable1.GetBookmark;
  BookmarkList.Add(TempBookmark);
end;

// Go to Bookmarks. ShowMessage is there just for me to check if it is pointing back to the right record.
procedure TFormTest.ButtonGoToBookmarksClick(Sender: TObject);
var Cnt: Integer;
begin
  for Cnt := 0 to BookmarkList.Count -1 do begin
    mySQLTable1.GotoBookmark(TBookMark(BookmarkList.Items[Cnt]));
    ShowMessage(mySQLTable1.FieldByName('Customer').AsString);
  end;
end;

Answer : Delphi 2010 TList and TBookmark issue

Hello everyone!

Paul Hughes already solved that issue on EDN. Thank you for help. Here is the link.
https://forums.embarcadero.com/message.jspa?messageID=254288

Kind regards
Random Solutions  
 
programming4us programming4us