Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Delphi 2010 TList and TBookmark issue

Avatar of dark3lf
dark3lf asked on
DelphiPascal
6 Comments1 Solution1710 ViewsLast Modified:
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
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;
ASKER CERTIFIED SOLUTION
Avatar of dark3lf
dark3lf

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers