>> find string "married"
>>
>> hit return: first instance of "married" is found and hilited.
>> arrow up to the same command in the message box. hit return again:
>>
>> Now, this is the "weird" part and the one that is causing havoc trying to
>> build a solid set of find and find again handlers:
>>
>> The find moves forward to the next card with the instance of "married" and
>> even scrolls the text to show that paragraph. BUT IT IS NOT HILITED! if I
>> issue the command again, it does not move on to the next instance, but only
>> hilites the text it just found...
> Very weird. Seems like a bug.
Scott explained the problem which is that I have a "on scrollBarDrag"
handler in the field, which hides some graphics.
Scott said:
=
> Sounds like the foundChunk is being reset by some other handler.
> Do you have a scrollbarDrag or openField or some other handler
> that could be doing this?
Yes, I did...
> Find works, but you do have to be careful not to do anything
> to cause it to clear the foundChunk. This is just standard
> behavior carried over from HyperCard and SuperCard, annoying
> as it may be...
and also:
> My guess would be that you're just doing something that is clearing
>the foundChunk. Even opening the Message Box can do this, because
>it changes the keyboard focus to a different window. Focusing another
>object even in the same window can also do this, as can any number
>of things in an openCard handler.
>The basic rule is, if you need the foundChunk in any statement other
>than the one immediately following the find statement, you need to
>save it away. You should also generally lock messages when doing
>a find in a stack that has openCard handlers that change the keyboard
>focus or delay the return for any other reason.
this now works like a charm, even with the "on scrollBarDrag" still in
place:
global gSearchString
on menuPick pWhich
switch pWhich
case "Find"
ask "Find What?"
put it into gSearchString
set the lockmessages to true
find string tgSearchString
if the result is not empty then answer "Sorry, no such text. Note, this
search is case sensitive." with "OK"
break
case "Find Again"
set the lockmessages to true
find string gSearchString
break
end switch
end menuPick
=====
It now moves down through the field, scrolling up for the next instance and
on to the next card after the last instance in the current field! Simple but
subtle. Thanks Scott!
Hinduism Today
Sivakatirswami
Editor's Assistant/Production Manager
[EMAIL PROTECTED]
www.HinduismToday.com, www.HimalayanAcademy.com,
www.Gurudeva.org, www.hindu.org
Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.