Removing a particular text style from a field

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Removing a particular text style from a field

Post by FourthWorld » Sun Feb 09, 2020 12:52 am

kaveh1000 wrote:
Sat Feb 08, 2020 10:47 pm
I was just about to post that I was thinking of styledText when I referred to the arrays. I think, Hermann, that you commented a long time ago on a problem I had, after Trevor suggested styledText.

I don't quite understand what would be best for me, from your comments. In my case I want to have a range of styles available, as well as backgroundcolor, box around paras, etc.
The styledText array is different from the array-flavored syntax for toggling style runs.

For the task presented here, toggling styles runs, the syntax I gave is Mark Waddingham's suggestion for such things. Indeed, he added it specifically for that purpose, to get past the old HC way in which there was no simple way to preserve other styles while removing one.

The styledText array is worth knowing about for other things. In fact, all of the new field features added in v5.5 (paragraph-level formatting, outline lists, etc.) are so wonderful it's worth taking an afternoon to review them for when you need them later. I'm sure the docs have been moved to a more permanent home, but I've grown accustomed to finding them in the Release Notes for that version, and it remains perhaps the best one-stop-shopping for those revisions - starting on p12:
https://downloads.livecode.com/livecode ... -5_5_4.pdf
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Talking LiveCode”