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

  1. /*
  2.    Listing 19.5  Partfind()
  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 partfind(expSeek, field_no)
  12. LOCAL x:=0, plist:={}, y:=len(trim(expSeek)), rec:={}
  13. seek trim(expSeek)
  14. if found()
  15.    do while !eof() .and. ;
  16.       trim(expSeek)=substr(fieldget(field_no),1,y)
  17.          Aadd(plist,fieldget(field_no))
  18.          Aadd(rec,recno())
  19.    enddo
  20.    x := achoice(5,20,15,45,plist,.T.)
  21.    if !empty(x)
  22.       goto rec[x]
  23.       return .T.
  24.    endif
  25. endif
  26. return .F.
  27.  
  28. // end of file CHP1905.PRG
  29.