Thanks for all the ideas, but what I had in mind was a function which
searched the currently active edit field for a string and highlited
that string in the edit field. My current code follows (note I tried
to make it fast so it is not as clean as it could be):
local fn SearchEditField(searchString$)
dim indx, k, found, strlen, textlen, TEHndl&, TextHndl&
strlen = searchString$[0]
long if ( strlen > 0 )
TEHndl& = WINDOW(_efHandle)
long if ( TEHndl& )
textlen = WINDOW(_efTextLen)
long if ( textlen > 0 )
TextHndl&=FN TEGETTEXT(TEHndl&)
indx = 0
do
long if ( PEEK([TextHndl&]+indx) == searchString$[1] )
found = indx
long if ( strlen > 1 )
for k = 2 to strlen
long if ( PEEK([TextHndl&]+indx+k-1) <> searchString$[k] )
found = 0
k = strlen+1
end if
next
end if
long if ( found > 0 )
setselect indx, indx+strlen
TEAUTOVIEW( _zTrue, TEHndl& )
TESELVIEW( TEHndl& )
indx = textlen
end if
end if
inc(indx)
until ( indx > textlen-strlen )
if ( indx <> textlen+1 ) then beep
end if
end if
end if
end fn
I know there is at least one error, it won't find a string starting
at the beginning of the edit field, but I've run out of time tonight
to debug it further. Using Munger would give me case insensitively
and I might switch to that later and give up the speed or keep both.
--
Michael Kluskens <mkluskens@...>
Got a question? The answer is "I don't do windows."