Mary,

> ........I sure could use some help wrappin' my head around this one.

Try the following:

FIND BUTTON SCRIPT:
on mouseUp
  global gTextToFind,gTextToSkip,gChunk
  ask "What text do you want to find?"
  if the result is "Cancel" then exit mouseUp
  else
    put it into gTextToFind   -- to feed Find Again
    go first cd  --you may need this
    # start looking
    repeat forever
      put offset(gTextToFind, fld "storyText") into tTextOffset
      if tTextOffset <> 0 then   -- found it!
        beep
        put "char" && tTextOffset && "to" && tTextOffset + \
            length(gTextToFind) -1 && "of fld 1" into \
            gChunk  -- for colorizing
        put tTextOffset + length(gTextToFind) - 1 into \
            gTextToSkip  -- tells Find Again where to start
        # colorizing here
        # scroll the field
        exit mouseUp
      else
        if the number of this cd=the number of cds then exit repeat
        else
         go next cd
        end if
      end if
    end repeat
    answer "Sorry, the text was not found"
  end if
end mouseUp

FIND AGAIN BUTTON SCRIPT:
on mouseUp
  global gTextToFind,gTextToSkip,gChunk
  resetFoundText  -- takes highlighting off
  repeat forever
    put offset(gTextToFind, fld "storyText",gTextToSkip) into tTextOffset
    if tTextOffset <> 0 then   -- found it!
      beep
      put "char" && tTextOffset && "to" && tTextOffset + \
          length(gTextToFind) -1 && "of fld 1" into \
          gChunk  -- for colorizing
      add tTextOffset + length(gTextToFind) - 1 to \
          gTextToSkip  -- tells Find Again where to start
      # colorizing here
      # scroll the field
      exit mouseUp
    else
      if the number of this cd=the number of cds then exit repeat
      else
        put empty into gTextToSkip --reset for next cd search
        go next cd
      end if
    end if
  end repeat
  answer "Sorry, no more occurrences of the text were found."
end mouseUp

The repeat loops are practically the same. 
You need to ADD to gTextToSkip in the Find Again script.
gTextToSkip needs to be reset in the Find Again script. 
Not sure you need gChunk as a global.
Take out the beeps if they're annoying, I used them to be sure things 
were working.  

Nelson

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