home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / DVD!FX17.LHA / FrexxEd / fpl / BookMark.FPL < prev    next >
Encoding:
Text File  |  1994-11-18  |  1023 b   |  44 lines

  1. export int GotoBookMark(int num)
  2. {
  3.   string book;
  4.   int x, y;
  5.  
  6.   book=joinstr("BookMark_y", ltostr(num));
  7.   y=ReadInfo(book);
  8.   if (y) {
  9.     book=joinstr("BookMark_x", ltostr(num));
  10.     x=ReadInfo(book);
  11.     GotoLine(y, x);
  12.   } else
  13.     ReturnStatus("No book mark stored!");
  14.  
  15. }
  16.  
  17. export int SetBookMark(int num)
  18. {
  19.   string book;
  20.  
  21.   book=joinstr("BookMark_y", ltostr(num));
  22.   SetInfo(-1, book, ReadInfo("line"));
  23.   book=joinstr("BookMark_x", ltostr(num));
  24.   SetInfo(-1, book, ReadInfo("byte_position"));
  25.  
  26. }
  27.  
  28. {
  29.   int counter;
  30.   string book, key;
  31.   for (counter=1; counter<=10; counter++) {
  32.     book=joinstr("BookMark_y", ltostr(counter));
  33.     ConstructInfo(book, "", "", "ILH", "", 0, 0);
  34.     book=joinstr("BookMark_x", ltostr(counter));
  35.     ConstructInfo(book, "", "", "ILH", "", 0, 0);
  36.  
  37.     key=joinstr("'F", ltostr(counter), "'");
  38.     AssignKey(joinstr("GotoBookMark(", ltostr(counter), ");"), key);
  39.     key=joinstr("'F", ltostr(counter+10), "'");
  40.     AssignKey(joinstr("SetBookMark(", ltostr(counter), ");"), key);
  41.   }
  42. }
  43.  
  44.