home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP19.EXE / CHP1906.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  610 b   |  24 lines

  1. /*
  2.    Listing 19.6  Psearch()
  3.    Author: Joe Booth
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. function Psearch(cKey, nRange, nField)
  12. LOCAL arr_ := {}
  13. local oldsoft := set(_SET_SOFTSEEK, .T.)
  14. seek cKey
  15. skip -nRange
  16. while len(arr_) < (nRange*2) .and. !eof()
  17.     Aadd(arr_,Fieldget(nfield))
  18.     skip +1
  19. enddo
  20. set(_SET_SOFTSEEK, oldsoft)    // restore previous SOFTSEEK setting
  21. return arr_
  22.  
  23. // end of file CHP1906.PRG
  24.