Invisible HTMLText Character?

Scott Rossi scott at tactilemedia.com
Wed Sep 22 13:20:57 EDT 2010


Hey Jim:

Thanks for the suggestion.  I'm considering using multiple fields but am not
sure yet as bulleting needs to be able to applied and removed at will, plus
I have to support up to two levels of indenting.  But one item in your code
caught my eye: formattedText.  I've used all of the formatted... properties
before except this one.  Thanks for that!

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design



Recently, James Hurley wrote:

> Scott,
> 
> Here is a thought.
> 
> Try this:
> 
> Create two narrow fields. The first field consists of one line of text
> that wraps into two lines in the field. (Perhaps a bullet and you want
> to indent the wrapped portion of the line.)
> 
> Run this script:
> 
> on mouseUp
>     put "" into field 2
>     wait 10 tick --So you can see the changes
>     put the htmltext of field 1 into tHTMLtext
>     --Find out where the lines break using the formattedText
>     put the formattedtext  of field 1 into tText
>     --The first line is the beginning of the bullet
>     --The second line is to be indented.
>     put line 2 of tText  into tString
>     put the offset(tString, tHTMLtext) into tNum
>     --Create nonbreaking spaces
>     --If you use breaking spaces they are ignored by HTML
>     --at the start of a line.
>     repeat 4 times --More or less
>        put " " after temp
>     end repeat
>     put temp before char tNum in tHTMLtext
>     set the htmltext of field 2 to tHTMLtext
> end mouseUp
> 
> The second line (the wrapped line) will be indented by 4 nonbreaking
> spaces beyond the first line.
> 
> There may be problems if there is formatting in the wrapped line.
> 
> My apologies to and the other respondents to this thread. Sorry, I
> haven't been paying attention.
> 
> Jim Hurley





More information about the use-livecode mailing list