array problems...

BlitzMax Forums/BlitzMax Beginners Area/array problems...

Najdorf(Posted 2005) [#1]
whats wrong with this...
Global a[][]=[[1,2],[3,4]]

Print a[1,1]


AND, how do i declare a multiarray without using the autoarray?

(In other basics I would use "local a[2,2]")


marksibly(Posted 2005) [#2]
Hi,

a[][] is an array of arrays, while a[,] is a single 2D array.

Try:
Global a[][]=[[1,2],[3,4]]
Print a[1][1]



Perturbatio(Posted 2005) [#3]
I added a page to the wiki that attempts to explain arrays of arrays (amongst other things): http://www.blitzwiki.org/index.php/Arrays


Najdorf(Posted 2005) [#4]
Thx