regex to locate text and colorize it in a list

Roger Eller roger.e.eller at sealedair.com
Wed Aug 10 07:45:13 EDT 2011


On Tue, Aug 9, 2011 at 7:49 PM, John Craig wrote:

> That should be exactly what the snippet does - maybe I got your test data
> wrong.  An occurrence of the first item in the fourth item is colorised.
>
>
> Sent from my iPhone
>
> On 10 Aug 2011, at 00:25, Roger Eller <roger.e.eller at sealedair.com> wrote:
>
> > On Tue, Aug 9, 2011 at 6:19 PM, John Craig wrote:
> >
> >> Hi, Roger.  Here's a quickie - create a stack with two fields ('in' and
> >> 'out')  put your data into field 'in' and the following into the button
> >> script;
> >>
> >> on mouseUp
> >>  set itemDel to tab
> >>  put fld "in" into tData
> >>  put the num of lines in tData into tLines
> >>  repeat with i = 1 to tLines
> >>     put item 1 of line i of tData into tNumber
> >>     replace tNumber with "<font color=red>" & tNumber & "</font>" in
> item
> >> 4 of line i of tData
> >>     put "<br>" after line i of tData
> >>  end repeat
> >>  set the htmlText of fld "out" to tData
> >> end mouseUp
> >>
> >>
> >> HTH
> >>
> >> :)
>  >>
>

>  John - I sent you a simplified example stack off-list.
>
> ˜Roger
>
>
For those following this thread, John's code works flawlessly (if I use
clean data).  I had spaces surrounding the text of each column after
replacing "TAB" with TAB.

˜Roger



More information about the Use-livecode mailing list