Speeding up array initialization

Richard Gaskin ambassador at fourthworld.com
Sat Nov 22 13:41:29 CST 2003

jbv wrote:

>>> QUESTION : is there a way to speed up things to initialize this array ?
>> If he array is to be empty it may not matter, but if the array is to contain
>> data and the data is in some delimited format you can use the split command
>> to convert it to an array and the combine command to convert it back if
>> needed.
> Thanks for the suggestion, but I already tried that : please correct me if I'm
> wrong, but it looks like the split command only works for 1 dimensional
> array. I mean : if the variable contains only 1 line of comma-separated items,
> then "split myVar using comma" will produce a 1 dimension array.
> But if myVar contains several lines of comma-separated items, then unexpected
> results are produced? Anyway, the split command doesn't seem to be tailored
> for arrays with more than 1 dimension...
> Furthermore, I tried to produce 2-dimension arrays from 1-dimension array :
> put 0 into S[1]
> put S into T[1]
> but that doesn't work..;
> Am I missing something ?

Remember that Rev's arrays are associative arrays.  While it lets you use
multi-dimensional syntax, what's really happening is that the key to an
element is the string "<value>,<value>".

 Richard Gaskin 
 Fourth World Media Corporation
 Ambassador at FourthWorld.com       http://www.FourthWorld.com
 Tel: 323-225-3717                       AIM: FourthWorldInc

More information about the use-livecode mailing list