How to to type bottom to up and right to left in a field

Richard Gaskin ambassador at fourthworld.com
Thu Sep 21 15:29:14 EDT 2017


Mark Waddingham wrote:

 > Whenever a range of text is set in a field, the selection is set to
 > the beginning of the chunk that was set - so in the case of 'replace'
 > acting on the whole field, that would be the beginning.
 >
 > Using the '(replacing | preserving) styles' form works slightly
 > differently - it iterates through the content of the field, and only
 > mutates the parts which are to be replaced. So with that form, the
 > selection index would end up being the beginning of the last
 > occurrence of x which was replaced with y.
 >
 > The rule is relatively sensible I think - since if a range of text is
 > replaced, the only index you can guarantee will be in the same place
 > as  it was before is the beginning of the range which was replaced...

Yes, quite sensible with that description.  Thanks.

 > The textChanged message is a bit of a blunt instrument -  mainly
 > because it was the best we could add to the field at the time
 > without potentially ending up down a whole set of rabbit warrens, or
 > impacting performance too much.

As I was writing my post I pondered what a proposed change might be, and 
I couldn't think of a good one.  Yes, it is a blunt instrument, but with 
that it's also predictable, and consistent with other text messages.

Maybe there's a better way, but frankly where I've used it in real-world 
projects I've found the textChanged message very useful as-is.

-- 
  Richard Gaskin
  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 mailing list