Re: How to stay on a card when repeating a « find »
J. Landman Gay
jacque at hyperactivesw.com
Sat Feb 4 12:27:31 EST 2006
André.Bisseret wrote:
> Hi !
> I have a background field that displays different texts on the different
> cards of the background.
> I need to find all the occurrences of one word (or string) on one card
> only, in order to highlight each occurrence (set the backgroundColor).
> So, when there is no more occurrence of a word on the current card, I
> must prevent the find to proceed on following cards.
If your stack does not have too many cards, this works:
repeat with x = 1 to the number of cds
set the dontsearch of cd x to true
end repeat
set the dontsearch of this cd to false
-- now use "find" to do the search here
The "dontsearch" property disallows any searches in any fields. The
above script just sets all the cards so they are not searchable, then
reverts the current card so that it is searchable.
This is fast enough if the stack doesn't have a lot of cards. You'll
have to experiment to see if your stack is small enough to make the
delay unnoticeable.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list