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

  1. /*
  2.    Listing 23.11  Findmemo()
  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. //───── NOTE: must compile with the /N option!
  12.  
  13. function findmemo(cWord)
  14. LOCAL found_one:=.F.,arr_:={},x:=0
  15. select BOOKS
  16. go top
  17. while !eof()
  18.    if !empty(BOOKS->desc)        // Memo field
  19.       if (x:=at(cWord,BOOKS->desc)) >0
  20.          arr_ := mpostolc( BOOKS->desc,44,x,4)
  21.          found_one := .T.
  22.          exit
  23.       endif
  24.    endif
  25.    skip +1
  26. enddo
  27. if found_one
  28.    replace BOOKS->desc with  ;
  29.            memoedit(BOOKS->desc,8,20,19,65,.T.,,44,4,arr_[1],arr_[2])
  30. endif
  31. return NIL
  32.  
  33. // end of file CHP2311.PRG
  34.