Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TAdvMemo
How to use bookmarks

You can add a bookmark on a specific line with:
advmemo.Bookmarks[bookmarkindex] := linenumber;
You can retrieve the linenumber for a specific bookmark index with:
advmemo.Bookmarks[bookmarkindex]: integer;
Using :
advmemo.BookmarkIndex[bookmarkindex]: integer
is just for putting an extra number on the book mark icon in the gutter.

Example:
procedure TForm1.FormCreate(Sender: TObject); begin
   // load some file
   advmemo1.Lines.LoadFromFile('somefile.txt');
   // set first bookmark at line 100
   advmemo1.Bookmarks[0] := 100;
   // set second bookmark at line 200
   advmemo1.Bookmarks[1] := 200;
end;
 // code to move to the first bookmark, i.e. jump to line 100; begin
  advmemo1.GotoBookmark(0);
end;