Re: "find" start position manipulation?

Scott Raney ((no email))
Fri, 17 Mar 1995 17:55:24 -0700 (MST)

> This presents a problem...
>
> I have created scripts that search for a word or phrase, then act on it in some
> fashion (change the font, style, whatever...). There is a find next button
> that I want to find the next occurance of the phrase. But after I have done
> the action on the found text, it loses the foundText location. So clicking on
> the find next button starts at the beginning of the card's fields again. This
> is not consistent with other Search/Find type capabilities found in other
> applications, particularly with word processors. Is there a way to deal with
> this situation and if not, can enhancements be made in future versions of MC
> that could fix this problem?

You probably shouldn't be using "find" for this anyway. Find is
intended to be used as an end-user searching tool, not as a
programmatic facility (which is why when you change the field contents
in any way it clears the foundChunk). In your case, using the offset
function, which in MetaCard 1.4 *does* take a starting point so it
doesn't always start at the top of the field, is probably the better
approach. If you want to search the whole stack, you'll have to write
a nested "repeat" loop to search for the string in each field of each
card in the stack.
Scott

> --Bruce
>
> --
> * Bruce G. Holm 503-685-1350 email: bruceh@wv.mentorg.com
> * Mentor Graphics Corp. 503-685-7000
> * 8005 SW Boeckman Rd.
> * Wilsonville, OR 97070-7777 Disclaimer: Opinions expressed are my own!
>
>

-- 
***********************************************************************
* Scott Raney  303-447-3936            Remember: the better you look, *
* raney@metacard.com                   the more you'll see -- Lidia   *
***********************************************************************