Hi Gene
Well. What you need is to store the number of the line the previous hit was
on and on searching
the lines below for a possible next hit...
Something like
repeat with i = PreviousHit + 1 to member("ZoneMastText").line.count
should help you along.
Pekka
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Gene Fritzinger
> Sent: 26. kesakuuta 2001 18:33
> To: [EMAIL PROTECTED]
> Subject: <lingo-l> Help with modifying this code to "Search Again"
>
>
> Good morning List,
>
> Sorry about that, I hit the Send button prematurely earlier.
> I've writen the code below to act as a searching function. There
> are 2 fields (member "searchFor") which, on keyUp looks in field
> 2 "ZoneMastText" for a match of what was entered in "searchFor"
> and will hilite the entire line of the first match it finds.
> What I'd like to do is add another button labeled "Search Again",
> that when clicked, will jump to the NEXT occurrence of the
> searchFor text, and if there are no more occurences, will stay
> hilited on the last occurrence. Can anyone suggest the best way
> to do this?
>
> on keyUp
> searchStr = member("searchFor").text
> pMember = member "ZoneMastText"
> repeat with i = 1 to member("ZoneMastText").line.count
> set lineNumber = lineNumber + 1
> if member("ZoneMastText").line[i] contains searchStr then
> if lineNumber = 1 then
> startChar = 1
> else
> startChar = (pMember.text.line[1..lineNumber - 1]).length + 2
> end if
> endChar = (pMember.text.line[1..lineNumber]).length + 1
> hilite char startChar to endChar of field pMember
> member("ZoneMastText").scrollTop = 0
> scrollByLine member "ZoneMastText", lineNumber - 10
> exit repeat
> end if
> end repeat
> end
>
> Thanx in advance,
> g fritzinger
>
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
> email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo. Thanks!]
>
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]