Complete Crash or Engine Hang: which is better?

Mark Smith marksmithhfx at gmail.com
Sun May 2 11:21:45 EDT 2021


Frightening and wonderful at the same time. When I did these exercises and then copy pasted a styledText string from LC into TextEdit, it was interesting to see what they agreed on, and what they didn't. For example, when colouring “numbers” both fields ignored numbers followed by “,” but not by a “.” So they were in agreement there. However, words containing a “y” were italicized in LC (that was the request) but interpreted as bold/underlined in TextEdit? 

More remarkably, I have no idea how they can stuff that much style info into a text string 😊

Mark


> On Apr 29, 2021, at 7:23 PM, Richard Gaskin via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> 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
> > (https://forums.livecode.com/viewtopic.php?f=7&t=32727)
> 
> 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 FourthWorld.com                http://www.FourthWorld.com
> 
> _______________________________________________
> 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