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

Peter Haworth pete at lcsql.com
Thu Feb 20 16:21:24 EST 2014


I don't think that's an error.  The textstyle array has keys named after
the actual textstyles, but empty and plain are not styles, they're just a
way of saying there is no style to be applied so the textSTyle array has no
keys for them.  Setting the textstyle to empty is the same as setting the
textStyle["bold"] to false along with all the other textstyle keys.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>


On Thu, Feb 20, 2014 at 12:28 PM, Richmond <richmondmathewson at gmail.com>wrote:

> 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.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list