In a message dated 8/12/01 10:04:18 PM, [EMAIL PROTECTED] writes:

<< This is for Jack who asked:

"Ok could you give me a find script that does what the message box find
command will do? That is a continual search for a word until it exhaust the
stack."

make a button: call  it Find

put this script  in it:

global gSearchString
on menuPick pWhich
  switch pWhich
  case "Find"
    ask "Find What?"
    if it is empty then break
    set cursor to watch
    put it into gSearchString
    set the lockmessages to true
    find string gSearchString
    if the result is not empty then answer "Sorry, no such text." with "OK"
    break
  case "Find Again"
    set cursor to watch
    set the lockmessages to true
    find string gSearchString
    break
  end switch
end menuPick

Enter into button contents the following

/FFind
/GFind Again

use command F to invoke the dialog to enter the string, cmd=G to find
subsequent instances... note this find is "touch sensitive" (because it uses
the internal "find" engine) it will move forward through the stack to the
next instance, but if you change focus with the mouse at any time it will
start at the beginning again... if you want to make sure a user doesn't do
that, lock all fields. Or, if you need activity between subsequent finds,
then you will need to use an offset routine (I have that also, but its more
complicated... and sounds like you don't need it.)


Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
[EMAIL PROTECTED] 
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org >>

Tryed the script and couldn't get it to show the ask box-I modified it a bit 
and got it to work but I had to type in the word I was searching for each 
time.  Thanks for the help I'm learning alot.

Here's the script I used:

On mouseUp
      ask "Find What?"
      if it is empty then break
      set cursor to watch
      put it into gSearchString
      set the lockmessages to true
       find string gSearchString
       if the result is not empty then answer "Sorry, no such text." with "OK"
       break
       set cursor to watch
       set the lockmessages to true
      find string gSearchString
       break
end mouseUp


Reply via email to