Failing to understand the oddities of the "line" chunk
Bob Sneidar
bobs at twft.com
Mon Mar 19 12:47:23 EDT 2012
If it resolves to an insertion point, then it's doing exactly what you would expect. It's putting something into that insertion point.
Bob
On Mar 18, 2012, at 9:32 PM, Geoff Canyon wrote:
> 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.
>>
> _______________________________________________
> 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