Split by null

Sebastien Nouat sebastien.nouat at livecode.com
Thu Jul 23 13:08:57 EDT 2015


Hi Peter,

After looking more into the issue, it appears that you have been 
exploiting a bug in LiveCode 6.7 for a long time, that's not a bug in 
LiveCode 7.0 :)

If you change
    by NULL
with
    by ";"
then you will have the same thing in 6.7 as you see with NULL in 7.0: 
the behaviour described in the documentation.

I suggest you to get a look at the bug report 
(http://quality.runrev.com/show_bug.cgi?id=15641) for more explanations.

Regards,

Sébastien

On 23/07/2015 16:47, Ali Lloyd wrote:
> Moreover, that example succeeds in LC 7!
>
> On Thu, Jul 23, 2015 at 4:04 PM Paul Dupuis <paul at researchware.com> wrote:
>
>> On 7/23/2015 1:11 AM, Peter Bogdanoff wrote:
>>> A heads up:
>>>
>>>        split tText by cr and null
>>>
>>> works differently in LiveCode 7 than it did in LC 6. The cr parameter is
>> OK, but the null adds another cr when this expression is used in LC 7.
>>
>> I am trying to understand what the intent is/was of using "and null" as
>> it seems to be functionally irrelevant in the example stack. i.e. 'split
>> tText by cr' and 'split tText by cr and null' produce identical results
>> in LC6
>>
>> the 'and null' would only be relevant in the split command if you had
>> array keys separated from array values by nulls in your data (example
>> below) and using a null as a delimiter seem odd
>>
>> put "A"&null&"apple"&cr&"B&null&"bottle"&cr&"C"&null"&"cradle"&cr into
>> myVariable
>> split myVariable by cr and null
>>
>> to presumably get
>> array[ A ]=apple
>> array[ B ]=bottle
>> array[ C ]=cradle
>>
>> However, the statements above fail in Livecode 6 in that the output you
>> get is:
>> array[ 1 ]=A apple
>> array[ 2 ]=B bottle
>> array[ 3 ]=C cradle
>> where the "white space" between A and apple is a null, split fails to do
>> anything with a null delimiter in LC6 (tested in LC6.7.5)
>>
>> For data that is just:
>> Line 1
>> Line 2
>> Line 3
>> the proper syntax seems like it should just be 'split tText by cr'
>>
>>
>>
>> _______________________________________________
>> 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
>>
> _______________________________________________
> 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


-- 
Sébastien Nouat
LiveCode Development Team





More information about the use-livecode mailing list