using "split" to build multi-dimensional arrays ?

Wouter wouter.abraham at scarlet.be
Tue Jun 7 08:01:29 EDT 2005


On 07 Jun 2005, at 13:44, jbv wrote:

> Hi list,
>
> When I run the following script :
>
>   put "a,b,c,d,e" into L
>   repeat with j=1 to 2
>     repeat with i=1 to 5
>       put item i of L into W[j,i]
>     end repeat
>   end repeat
>   combine W using cr and comma
>   put W
>
> I get this :
> 1,1,a
> 1,2,b
> 1,3,c
> 1,4,d
> 1,5,e
> 2,1,a
> 2,2,b
> 2,3,c
> 2,4,d
> 2,5,e
>
>
> ------
> but when I add the 3 following lines :
>
> put W into W1
> split W1 by cr and comma
> put W1[2,5]
>
> I get empty...
>
> Does that mean that "split" can't be used to build
> 2 dimensional arrays ?
>
> Thanks,
> JB

Better use a different char to combine the array if you want to split  
it later back into an array.
You used the comma  already as an itemdelimiter.

Greetings,
Wouter


More information about the use-livecode mailing list