LoginLogin

Arrays

Root / Programming Questions / [.]

HumbleWarioCreated:
Em, just a quick question I've been having trouble with I have an array and I'm trying to find a way that I can copy one piece to a variable. So if I have a 4x3 array and I want to copy 2x1 to variable A, what should I do?

If you have a 4x3 array and want element (2,1), it's as simple as saying what you want pretty much :)
DIM SOMEARRAY[4,3]
'...something...
SOMEVAR = SOMEARRAY[2,1]
That would make some variable contain the (2,1) element of some array. In your case, just say A = SOMEARRAY[2,1]

I didn't know it was that easy. Thanks!