Failing to understand the oddities of the "line" chunk

Geoff Canyon gcanyon at gmail.com
Mon Mar 19 00:32:32 EDT 2012


So from a consistency standpoint, you are certainly correct; putting
something into a negative range should behave the same whether the chunk
involved is characters, items, words, or lines. But I'd still argue that
the use of "into" instead of "before" or "after" demands that the target
resolve to a valid range, which should be replaced by the command. Trying
to interpret it another way requires making an arbitrary decision about
using the starting or ending part of the expression, and whether to put the
string before or after that chunk -- arbitrary decisions that have
obviously been made in different ways for lines and chars.


On Sun, Mar 18, 2012 at 9:00 PM, J. Landman Gay <jacque at hyperactivesw.com>wrote:

> An inverted range in character chunking equates to an insertion point.
> I.e., char 2 to 1 of a line is an insertion point after char 1. Testing for
> range inversion is one way to know whether a selection has any content.
>
> The behavior with lines looks like the engine is attempting that but it
> isn't acting the same.
>
>
> > put "a"&  cr into t;put "b" into line 2 to -1 of t
>
> equates to "put 'b' into line 2 to 1". If inverted ranges should yield an
> insertion point, then the insertion should go after after line 1. So it
> isn't acting quite the same way but it looks like it's supposed to.
>



More information about the use-livecode mailing list