home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 23.11 Findmemo()
- Author: Joe Booth
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- //───── NOTE: must compile with the /N option!
-
- function findmemo(cWord)
- LOCAL found_one:=.F.,arr_:={},x:=0
- select BOOKS
- go top
- while !eof()
- if !empty(BOOKS->desc) // Memo field
- if (x:=at(cWord,BOOKS->desc)) >0
- arr_ := mpostolc( BOOKS->desc,44,x,4)
- found_one := .T.
- exit
- endif
- endif
- skip +1
- enddo
- if found_one
- replace BOOKS->desc with ;
- memoedit(BOOKS->desc,8,20,19,65,.T.,,44,4,arr_[1],arr_[2])
- endif
- return NIL
-
- // end of file CHP2311.PRG
-