Missing function selectedWords/selectedTrueWords

Mark Waddingham mark at livecode.com
Fri Aug 31 16:13:00 EDT 2018


On 2018-08-31 20:57, Tore Nilsen via use-livecode wrote:
> The array form may well be what I need. I do think I still will have
> to wait some time before I introduce it to my students.

Perhaps - certainly 'textFont' and 'textSize' have less syntactic 
baggage. However, the actual underlying form/pattern/functionality is 
identical:

   the <prop> of the selectedChunk

Returns "mixed" if <prop> is not the same across all chars, otherwise 
the value of <prop> (or empty if unset across all of them - i.e. 
inherited).

You could introduce the text style ones as 'prepackaged' units though:

   the textStyle["bold"] of the selectedChunk
   the textStyle["italic"] of the selectedChunk

This isn't really a 'lie' either - as these aren't really array 
properties in the same way as when you use that syntactic form as a 
custom property. In an ideal world they would have been done as 'the 
bold of' etc. We didn't do that for the simple reason that the number of 
times I have seen 'bold', 'italic' and other textStyle keywords as 
variable names and custom property names might be most surprising - i.e. 
had we, an unknown number of stacks would have broken, quite severely! 
[Although with hindsight perhaps we should have considered textBold / 
textItalic ... ].

Warmest Regards,

Mark.

P.S. Of course, at least one 'smart-ass' will ask 'why do those have 
brackety things when the others don't' - but aren't teachers well versed 
in dealing with such inquisitive minds? ;)

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list