using parse to extract indexed string
[1/2] from: rchristiansen::pop::isdfa::sei-it::com at: 13-Nov-2000 14:16
Parsing problem:
1. I want to parse a string and verify a keyword exists.
2. I want to mark the keyword with an index value.
3. I want to return to the marked index value and parse out index
value 'x to index value ('x + 100)
How do I do this? I'm having trouble understanding the use of index.
Here is my search code thus far...
directory-contents: read %./
; --- GET LIST OF FILE NAMES WITH VALID EXTENSIONS FROM
HELP DIRECTORY ---
file-list: copy []
for file-grab 1 (length? directory-contents) 1 [
file-name: first directory-contents
file-ext: find/last file-name "."
if file-ext = %.html [
append file-list file-name
]
directory-contents: next directory-contents
]
; --- QUERY HELP FILES FOR KEYWORD ---
pages-with-keyword: copy []
help-file-titles: copy []
keyword-count: copy []
foreach help-file file-list [
file-contents: read help-file
if find file-contents cgi-input/keyword [
append pages-with-keyword help-file
parse file-contents [thru <TITLE> copy text to </TITLE>
(append help-file-titles text)]
keyword: cgi-input/keyword
count: 0
parse file-contents [any [thru keyword (count: count + 1)]]
append keyword-count count
]
]
Thanks.
-Ryan
[2/2] from: gchiu:compkarori at: 14-Nov-2000 11:22
On Mon, 13 Nov 2000 14:16:36 -0600
"Ryan C. Christiansen" <[RChristiansen--pop--isdfa--sei-it--com]>
wrote:
> Parsing problem:
> 1. I want to parse a string and verify a keyword exists.
<<quoted lines omitted: 4>>
> How do I do this? I'm having trouble understanding the
> use of index.
There's an example in the core.pdf in the parse section on
indexing into a document.
--
Graham Chiu
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted