text color part 2

John Brozycki johnb at hvc.rr.com
Tue Nov 22 20:22:51 EST 2011


Thanks for the suggestion.  I've typically done just that to color text.  The problem is, in this case, the field contains plaintext that is actual html, and I need to be able to view it without it disappearing and modifying other text.  For example, a search could be done on, say, "<font" and I want it to find all of this occurrences and color them to make them stand out.  Mike's suggestion got me to an answer, and we both posted working solutions.

Just want to say how thankful I am for this list and everyone who has helped me either directly by replying to a question I asked, or indirectly by helping someone else and I've benefited from the answer.


On Nov 22, 2011, at 7:54 PM, Mark Wieder wrote:

> John-
> If you can get by without setting the background color, try using the
> htmlText property of the field, something like this:
> on mouseUp
>  local tText
>  local tStrReplace
>  put the htmlText of field "Original" into tStrReplace
>  put "<font color=" & quote & "red" & quote & ">" \
>    & field "SearchField" &\
>    & "</font>" into tStrReplace
>  replace field "SearchField" with tStrReplace in tText
>  set the htmlText of field "Results" to tText
> end mouseUp
> -- 
> -Mark Wieder
> mwieder at ahsoftware.net

More information about the Use-livecode mailing list