Styled Text, htmlText and Variables

Ron rbarber at
Wed Apr 30 19:30:01 EDT 2003

Hi Edwin

I do this kind of thing all the time with a repeat loop and
replace/replacetext as suggested by Björnke. I add html encoding to the
variable in the loop. It sounds like you are changing things in the fld?

if the author is item one in a list then:

repeat for each line l in thetext
put "<b>" & item 1 of l & "</b>" & item 2 to number of items of l & return
after newtext
end repeat

set the htmltext of fld 1 to newtext

Is this the kind of thing you are doing?

> That's what I figured. I have one thing where I build a list of artists with
> cd titles beneath them and I wanted to bold just the artists. Turned out that
> I needed to put a special character in front of the artists as I pulled them
> into a variable, then thunk them all into a field and go through and bold the
> marked lines and remove the special character. I was hoping that I could to it
> outside of the field, since I thought it might be a little faster.
> Ah stil only take 150 milliseconds  for 80 entries this way.

>> You just can't set the style or such, instead use
>> the replace and 
>> replaceText commands.
>> On Mittwoch, Apr 30, 2003, at 21:53 Europe/Zurich,
>> Edwin Gore wrote:
>>> Am I correct in thinking that you can't change
>> the style of or get the
>>> htmlText of a variable?
>>> It doesn't work when I try it, meaning that I
>> have to thunk the
>>> variable's content into a field to do these
>> thigns with/to it.
>>> I ask only be cause I am trying to optimize some
>> stuff...

More information about the use-livecode mailing list