I am trying to implement a simple search function in an eBook (see menu
script below) my problem is that the find function gets "stuck" on the
current card.
I need it to go forward and after finding the last instance of a string in
the present card, move to the next card etc. Presently it just loops back to
the first instance of that string in the same field on the same card? What
am I doing wrong? I do see that after the last find on the current card the
function returns a empty foundChunk. I suppose one can write a handle for
that which then "drives" the function forward to the next card, but I
thought "there is got to be an easier way."
on menuPick pWhich
switch pWhich
case "Find" --command key assignment is cmd-F
if the selection is not empty then
put the Selection into gSearchString
find string gSearchString
else
ask "Find what?"
put it into gSearchString
find string gSearchString
if the result is not empty then answer "Sorry, no such text." with
"OK"
end if
break
case "Find Again" --command key assignment is cmd-G
find string gSearchString
--this is the one that loops back to the top of the same field instead of
moving to the next card.
break
end switch
end menuPick
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.