home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 19.8 Keyword functions
- NOTE: calls PARSE, which is contained in CHP22xx.PRG
- 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
- */
-
- function keyw_build(cTitle,cId_code)
- LOCAL skip_words:={"A","THE","OF","AND"}
- LOCAL words:= Parse(upper(cTitle)," ")
- LOCAL jj
- use KEYWORD new index KEYW
- for jj = 1 to len(words)
- if ascan(skip_words,words[jj]) = 0
- append blank
- replace keyword with words[jj],id_code with cId_code
- endif
- next
- return NIL
-
-
- function keyw_find(cWord)
- LOCAL arr_ :={}
- use VIDEOS new index VIDS
- use KEYWORD new index KEYW
- select KEYWORD
- seek upper(cWord)
- while !eof() .and. upper(cWord) = KEYWORD->keyword
- select VIDEOS
- seek KEYWORD->id_code
- if found()
- Aadd(arr_,VIDEOS->title+' '+VIDEOS->id_code)
- endif
- select KEYWORD
- skip +1
- enddo
- return arr_
-
- // end of file CHP1908.PRG
-