Something like charIndex, but in a variable...
Peter M. Brigham
pmbrig at gmail.com
Sat May 2 09:14:46 EDT 2015
If the example you give is an accurate portrayal of what you are trying to do, why not just:
set the backcolor of char 1 of word 2 of line 3 of temp to "red" ??
-- Peter
Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig
On Apr 30, 2015, at 10:02 AM, Malte Brill wrote:
> Hi all,
>
> thanks for the replies so far.
>
> The problem with both matchChunk and offset are, that they will return the first occurance of the literal. So in a text like this:
>
>
> orange banana tomato
> banana tomato orange
> tomato banana orange
>
> on mouseUp
> local temp,tChar
> put fld 1 into temp
> put offset(char 1 of word 2 of line 3 of temp,temp) into tChar
> set the backcolor of char tChar of fld 1 to "red"
> end mouseUp
>
> Will hilite the first b instead of the one on line 3.
>
> @Mark: charIndex does not appear to be working on the templateField. And of course it is slower in 7… :-(
>
> All the best,
>
> Malte
>
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list