home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP25.EXE / CHP2509.PRG < prev    next >
Encoding:
Text File  |  1991-06-12  |  1.2 KB  |  41 lines

  1. /*
  2.    Listing 25.9. A replacement for b:refreshAll() which
  3.                  keeps the current row highlighted.
  4.    Author: Craig Yellick
  5.    Excerpted from "Clipper 5: A Developer's Guide"
  6.    Copyright (c) 1991 M&T Books
  7.                       501 Galveston Drive
  8.                       Redwood City, CA 94063-4728
  9.                       (415) 366-3600
  10. */
  11.  
  12. function dbRefresh(browse)
  13. /*
  14.    A replacement for b:refreshAll() that will keep the
  15.    current row highlighted, used primarily when you've
  16.    moved the record pointer via SEEK or GOTO such that
  17.    the record is still on the screen. If the entire screen
  18.    has to be redrawn with new data, this function will
  19.    have no net effect beyond the actual b:refreshAll()
  20.    and won't cause any delays.
  21. */
  22.  
  23. //  Remember where we ended up.
  24. local rec := recno()
  25.  
  26.   //  Perform the initial stabilizing process.
  27.   browse:refreshAll()
  28.   do while .not. browse:stabilize() ; enddo
  29.  
  30.   //  Most of the time this will be false,
  31.   //  so no work will be done.
  32.   do while recno() <> rec
  33.     browse:up()
  34.     //  Need to stabilize again.
  35.     do while .not. browse:stabilize() ; enddo
  36.   enddo
  37.  
  38. return nil
  39.  
  40. // end of file CHP2509.PRG
  41.