> orange banana tomato
> banana tomato orange
> tomato banana orange
Experimenting with regex...
Sorry, couldn't resist :)
function MalteCharIndex T, nWord, nLine,@p1, @p2
get format( "(?mx)(?: .*? \\n){%d} (?: (\\w+) [\\W]*){%d}", nLine
-1, nWord)
return matchChunk( T, IT, p1, p2)
end MalteCharIndex
and run it this way:
on mouseUp
put field "fEntry" into theText
put 5 into nLine
put 7 into nWord
if MalteCharIndex( theText, nWord, nLine, tStart, tEnd) then
select char tStart to tEnd of fld "fEntry"
else
beep
end if
end mouseUp
Did a couple of tests and looks good so far.
Sure, a lot of room for improvement.
Thierry
------------------------------------------------
Thierry Douez - http://sunny-tdz.com
Maker of sunnYperl - sunnYmidi - sunnYmage
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode