Translate metadata to field content
ambassador at fourthworld.com
Wed Feb 19 03:58:44 EST 2020
J. Landman Gay wrote:
> I was surprised to see two things:
> 1. FormattedStyledText appears nowhere in the dictionary. I didn't
> know it existed.
Me neither. Weird, as it's very powerful, the key to solving problems
just like this one, and a great many besides.
I just flagged the omission:
> 2. FormattedStyledText treats some punctuation as a new run, even if
> it has not changed text style. For example, semi-colons are
> independent runs. Very odd.
That is odd. As I play with it I'll see if anything else suggests the
"why" behind that pattern. Maybe Mark Waddingham can offer some insight
> I need to do some experimentation and timing tests, but thanks to all
> for the responses.
I spoke Dr. Peter Brett a couple years back about performance of using
styledText vs htmlText for tasks where either would be a suitable option.
He reinforced something Mark Waddingham had once written here (or maybe
it was Trevor?), that the styledText array most closely fits the
internal structures of field contents.
In contrast, htmlText requires extensive parsing to achieve similar
results, and usually with much more overhead as expected with such parsing.
In Peter's view, he would be surprised to find any case where parsing
htmlText would be faster than working with the styledText array. I have
no reason to doubt him, and have been using styledText as the basis for
most things I used to use htmlText for when writing new code.
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode