Speed in setting text styles

Sarah Reichelt sarahr at genesearch.com.au
Mon Oct 25 19:45:26 EDT 2004


This looks like much the best solution so far. I had the same problem 
coloring certain lines in a large field and used a similar approach to 
reduce the time. However the html that Mark suggests to bold the text 
does not have the tags nested correctly. It will probably display OK, 
but for correctness, the tags should not overlap. Replace the relevant 
line with:
    put "<p><b>" & L & "</b></p>" & cr after changedData -- bold text

Cheers,
Sarah

On 26 Oct 2004, at 3:25 am, Mark Smith wrote:

> Or to avoid having to count up to n every time:
>
> put fld tFld into tData
> repeat for each line L  in tData
> if [condition] then
>   put "<p>" & L & "</p>" & cr after changedData  -- plain text
> else
>    put "<p><b>" & L & "</p></b>" & cr after changedData -- bold text
> end if
> end repeat
> delete last char of changedData ---lose trailing cr
> set the htmlText of fld tFld to changedData



More information about the use-livecode mailing list