home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / text / edit / FrexxEdA.lha / FrexxEd / fpl / SearchCount.FPL < prev    next >
Text File  |  1995-07-19  |  550b  |  25 lines

  1. export int SearchCount()
  2. {
  3.   int BufferID=DuplicateEntry();
  4.   int foundcount=0;
  5.   int currentbuffer=GetBufferID();
  6.  
  7.   if (BufferID) {
  8.     CurrentBuffer(BufferID);
  9.     GotoLine(1, 0);
  10.     while (Search()>=0)
  11.       foundcount++;
  12.     CurrentBuffer(currentbuffer);
  13.     Kill(BufferID);
  14.     Request(joinstr("\"", ReadInfo("search_buffer"), "\" is found ",
  15.                     ltostr(foundcount), " times!"),
  16.             "SearchCount", "Understood!");
  17.   }
  18.  
  19. }
  20.  
  21. /* Assign "amiga control s" to the function */
  22.  
  23. AssignKey("SearchCount();", "amiga control s");
  24.  
  25.