Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!aero!tsung From: tsung@aerospace.aero.org (Fu-Sheng Tsung) Newsgroups: comp.sys.mac.hypercard Subject: Re: Want find next button Message-ID: <60389@aerospace.AERO.ORG> Date: 31 Oct 89 05:56:35 GMT References: <26510.253D984C@cmhgate.FIDONET.ORG> <8764@hoptoad.uucp> <8784@hoptoad.uucp> Reply-To: tsung@cs.ucsd.edu Organization: University of California, San Diego Lines: 22 One way to do "find next" in a field is to write your own "find" routine in the script. Say you found the string on line N the first time, and that the field has M lines. "Find next" would search for the string beginning at line N+1 of the field; that is, you can global N, M get offset(searchString,line N+1 to M of field "Text") if it <> 0 then -- string found -- update scrolling select char it to length(searchString) + it -1 of\ line N to M of field "Text" -- update N (+ the number of lines in char 1 to it of ...) else -- not found, or no more occurances The main trick here is that you can actually specify a subfield ("line N to M of field") in place of a field specification. This is more work than Barry's "index find" method, e.g. you need to update the scrolling yourself, but the operation can look very nice (and consistent with "Find") to the user. Fu-Sheng Tsung