Something like charIndex, but in a variable...
Walt Brown
walter.h.brown at gmail.com
Thu Apr 30 15:52:27 EDT 2015
I'm not sure I get it Malte. If you already know which line your target is
on, then just limit the chunk expression to that line.
On Thu, Apr 30, 2015 at 10:51 AM, <dunbarx at aol.com> wrote:
> Malte.
>
>
> Just so. Too fast on keyboard, too slow in brain. How about this:
>
>
>
> on mouseUp
> put fld 1 into temp
> get the number of chars of word 1 to 8 of temp -- first char
> answer it & "," & the number of chars of word 8 of temp + it
> end mouseUp
>
>
> Craig
>
>
>
> 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
>
>
>
>
>
> -----Original Message-----
> From: Malte Brill <revolution at derbrill.de>
> To: use-livecode <use-livecode at lists.runrev.com>
> Sent: Thu, Apr 30, 2015 10:03 am
> Subject: Something like charIndex, but in a variable...
>
>
> 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
>
> _______________________________________________
> 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