Split, combine ok but where's extract?

Alex Tweedly alex at tweedly.net
Sat Feb 12 19:36:26 EST 2005


Alex Tweedly wrote:  

And now corrects himself ...)

> David Vaughan wrote:
>
> David,
> I may have missed something in the original problem description, but I 
> think there's a problem with this scheme.
>
> If you take the case of
>   put "1,2" into myArray[a,b]
>   put "1,3" into myarray[c,d]
>
> I believe what Xavier wants (at least, what his posted code gives - 
> though it used a simple table not keys) is
> v1 = a,c
> v2 = b,d
> v3 = 1,1
> v4 = 2,3
>
> Note particularly v3 - using the various "repeat" forms, it has each 
> item from the column.
>
> split/combine will remove duplicates - and hence give
> v1 = a,c
> v2 = b,d
> v3 = 1
> v4 = 2,3

Nope. It will actually give
v1 = a,c
v2 = b,d
v3 = 1
v4 = 3     **** the other value got lost in the split immediately before 
the assignment to v3; I don't know if it's theoretically guaranteed 
which of the values it will give, but in practice, with few entries, it 
will give the latter one.


-- 
Alex Tweedly       http://www.tweedly.net



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 10/02/2005



More information about the use-livecode mailing list