Complete Crash or Engine Hang: which is better?

Richard Gaskin ambassador at
Thu Apr 29 14:23:03 EDT 2021

Mark Smith wrote:

 > Thanks Richard, that probably explains it. There are style runs in
 > the TextEdit text (and not, say, in Atom or some other editor). It
 > was just odd to me because I think (quite simplistically) of text
 > being text and not expecting them to have style runs, but of course
 > they can.

Here's a fun exercise, well worth a few minutes of playing around: make 
a field, style some text in it, make a tree widget, and run this in the 
Message Box:

   set the arrayData of widget 1 to the styledText of fld 1

The styledText array is a great representation of field contents, much 
faster to work with than most HTML-parsing methods, and offering good 
insight into the internals of LC fields, being the closes match we have 
from a scripting interface to the underlying field structures.

The v5.something engine added some super-awesome text properties, with 
paragraph-level formatting and more.  Seeing them laid out in array 
format (the tree widget is great for that) really illuminates how things 
are laid out.

 > This also began because not only could I not change my text, someone
 > else previously had this problem and eventually fixed it by deleting
 > the fields and starting over
 > (

Yeah, I posted pretty much the same comment there, but like much of what 
I used to write in the forums it was ignored in favor of doing a lot of 
unnecessary work. :)

 > I now suspect it may have been style runs in their text as well.

When things show up that look like extreme problems that would affect 
nearly every user, it's probably not a regression.  Not that the team's 
automated testing can catch everything (though it catches a lot), but 
just that bugs that affect large numbers of people in ways that prevent 
core use of the product generally don't live long, if they live long 
enough to get past early beta at all.

So if we truly had mysteriously immutable text styling, chances are good 
it would be caught in a Preview build, long before RC.  Good enough to 
check style runs, anyway. :)

 > I don’t tend to run into this sort of problem because I’m rarely
 > concerned with the style of text, but in this particular case I
 > actually did want to change the font size and color and couldn’t,
 > and that had me puzzled. Ok good, I think you've solved this.
 > Thanks for weighing in.

Happy to help others avoid pitfalls I've run into myself. I hope that 
solves it for you.

I had a head-scratching moment over exactly this many years ago.  Just 
sharing what I've learned, so others don't have to replicate my mistakes.

  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  Ambassador at      

More information about the use-livecode mailing list