set the textStyle["box"] of word x of line y to true is very fast

Richmond richmondmathewson at gmail.com
Thu Feb 20 15:28:25 EST 2014


On 20/02/14 12:41, Richmond wrote:
> On 20/02/14 11:00, BNig wrote:
>> Hallo Thierry,
>>
>> it is about the same:
>> 1200 milliseconds on a text of 1000 lines and about 2.000.000 chars.
>>
>> the point is that using "set the textStyle["bold"]" on chunks is a lot
>> faster, on top it preserves preexisting textStyles of the chunk 
>> whereas "set
>> the textStyle of chunk to "bold"" is slower and wipes preexisting
>> textStyles.
>>
>> Although I noticed "set the textStyle["plain"]" or "set the
>> textStyle["empty"]" throws an error. I think it should be allowed.
>

Do they?

That's odd, as the documentation has this:

"Value:
The textStyle of an object or chunk is either "plain", empty, "mixed", 
or one or more of the following, separated by commas:
* bold
* italic
* underline
* strikeout
* box
* threeDbox
* link (or group)
* condensed
* expanded

Comments:
Setting the textStyle to "plain" turns off all styles. (Setting the 
textStyle to "plain" plus one or more additional styles may result in 
anomalous behavior.)"

However, having just tested them (LC 6.6) I can confirm that they do 
throw errors.

Bug report time!

Richmond.




More information about the use-livecode mailing list