Hi -t,

I'm not sure what you're trying to do, but here are some ideas.

First, remember to put the data where you want it. FIND takes two arguments,
the first of which is the text you want to search through, and the second is
the string you want to search for. Here's an example:

>> z: copy find/last read %test.txt "main"
== "main ingredient.^/"

READ takes %test.txt as an argument, and READ's return value, plus "main"
make the two arguments for FIND. FIND's return value is copied, and assigned
to the word 'z. (If I didn't use COPY, the entire text of %test.txt would
exist as a string in the memory, and 'z would hold a pointer to the beginning
of the last occurrence of "main" within that string. With COPY, you only get
the last bit of the text of %test.txt in memory.)

Eric

------

>hey guys,
>
>I have trouble with the simplest stuff.
>
>How can I find the last occurance of a word in a file, then give that as
>a value of a word? like,
>
>read %file find/last "fred"
>caveman: fred
>
>what I've tried has not worked for me.
>
>thanks!
>--
>
>
>-t

Reply via email to