Last time. I swear. Really. Would help if I'd locate all the quirks before posting, eh?
The problem with the last code is that if nothing is found it still hilites from the beginning of the field for the number of chars in the search string. So to fix that.. on mouseUp set the wholematches to true put field "results" into field "results" set the traversalOn of field "Results" to true put the text of field Results into tResults put the text of field "SearchField" into strSearch put the length of strSearch into tLength put 1 into tFramePos put 0 into tPreviousOffset repeat while tFramePos <> 0 put Offset(strSearch,tResults,tPreviousOffset) into tFramePos if tFramePos <> 0 then -- check to see if there is a match THEN do the color change select char (tFramePos + tPreviousOffset) to (tFramePos + tPreviousOffset + tLength - 1) of field "results" set the textColor of the selection to red put tFramePos + tPreviousOffset into tPreviousOffset end if -- ta da! 12th time is the charm. end repeat select empty end mouseUp _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode