2 dimensional Arrays

Henk van der Velden henk at iglow-media.nl
Wed Mar 14 04:24:16 EDT 2007


Hi Otto,

Rev doesn't support 2 dimensional arrays, so you have to kind of fake  
them. That can be done by naming the keys the way you do. But if you  
want to get the value of a specific  key, you should use:
myArray["x" & comma & "y"]
instead of
myArray["x","y"]

Hope this helps.

You can also take a look at
http://www.sonsothunder.com/devres/revolution/tips/arry001.htm

Kind regards,

Henk
--------------------------
Henk v.d. Velden
iGlow Media
Magda Janssenslaan 36
3584 GR  UTRECHT
Netherlands

0031 (0)6 16 024 337
www.iglow-media.nl


> I have a two dimensional array in my program and I am having some  
> trouble
> getting values to come out of it.
>
> The array is keyed in both dimentions by entries such as "s1","s1"  
> "s1","s2"
> etc. (the quotes are included in the key for various reasons but  
> they could
> potentially be removed)
>
> the values in the array are either empty or 1
>
> if I call for a value using something like:
> answer myArray["s1","s2"]
> I will get the value returned to me but if I try to use variables  
> it doesnt
> work right.
> If I have a variable leftVar that contains "s1" and rightVar that  
> contains
> "s2" (both with quotes) and I say
> answer myArray[leftVar,rightVar]
> I get returned an empty message.
>
> I dont seem to have this problem when calling a single dimension  
> array, only
> in my 2-dimension one.
>







More information about the use-livecode mailing list