Mary,

>> gTextToSkip needs to be reset in the Find Again script.

>Let me know what you're thinking. I don't want to reset it outside of
>the FIND button because I always want to find the next occurrence after
>the previous found occurrence. In the single-card stacks, I could just
>hit Find Again all the way to the end of the field.

It's reset before moving to the next cd so searching will start at the 
beginning of the fld.

>I've cut out the colorizing and scrolling bits with rely on gChunk as
>well as resetFoundText, which returns the highlighted text to its
>original format.

Then you've removed your reason for using OFFSET.  FIND is an easier way 
to go anyway and you can locate, hilite text, etc. using FOUND 
information anyway. The following is a single background button script 
that should do the job. Changes its name and color as it does its work.

on mouseUp
  global findIt,searchLight
  if the short name of me is "Find" then
    ask "What text do you want to find?"
    if it is empty then exit mouseUp
    go cd 1  --or whatever is the first cd of the search fld
    put "go" into searchLight
    put it into findIt
    find whole findIt in fld "Storytext"
    if the result is empty then
      set the name of me to "Find Again"
      set the backcolor of me to "red"
    else answer "Sorry, the text was not found."
  else
    find whole findIt in fld "Storytext"
    if  searchLight is "stop" or the result is "not found" then
      answer "Sorry, no more occurrences of the text were found."
      set the name of me to "Find"
      set the backcolor of me to "green"
     end if
  end if
end mouseUp

For multi-card searches put the following in the cd script of the first 
cd of the search field. It just stops FIND from endlessly wrapping around.

on openCard
  global searchLight
  put "stop" into searchLight
end openCard

If you're talking about a one cd search field you can remove the 
searchLight stuff from the btn script.  Or leave it in.  Whatever suits 
your housecleaning preference.

NZN



Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to