Is it possible to set just one word of a text to bold ?

Ken Ray kray at sonsothunder.com
Mon Sep 11 16:47:09 EDT 2006


On 9/11/06 3:38 PM, "Devin Asay" <devin_asay at byu.edu> wrote:

> William,
> 
> On Sep 11, 2006, at 11:53 AM, William de Smet wrote:
> 
>> Hi there,
>> Thanks to JB and Ken it works but I want to go a little further.
>> Now I have 3 fields in which the user puts text and they all need to
>> be combined into one field (all three with htmlText).
>> The code used to work (without htmlText) and each line was pasted
>> after the last line.
>> Now it doesn't work anymore. And even the spaces between he separate
>> fields are gone. What am I doing wrong?
>> The code so far:
>> on mouseUp
>>  put "" &cr into tData
>>  if fld "doel" = empty
>>  then beep
>>  then answer error "Er is geen doel gekozen!"
>>  then exit mouseup
>> else put "<b>Doel</b>" &cr & the htmltext of fld "doel" &cr&cr
>> after tData
> 
> The problem is that now you are using htmltext instead of just
> putting text from the variable into the field. HTML ignores carriage
> returns, so what you'll have to do instead is this:
> 
>> else put "<p><b>Doel</b></p>" & the htmltext of fld "doel" & "</
>> p><p></p>" after tData

Right - this is called "normalizing" the data - all whitespace is
effectively replaced with spaces, and then the space runs are reduced to a
single space. So you can insert <p></p> tags or <br> tags where there were
CRs, and for space runs replace " " for each space (160 is the
non-breaking space character in HTML).

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list