Hi there,
I searched in Google and here in the forum but can't find any example or tutorial on declaring an array of array and on how to initialize it.
I mean something like
I started from the idea of an array of custom type:
This could be ok, but I need to manually initialize it with something like (in pseudo-Java code):
Is it possible to write something like this in B4A?
Otherwise, an array of array of two int could be ok, but I don't know how to initialize it, and even how to correctly declare it. Possibly something like:
I wrote the code up there since it didn't give me syntax error!
And then, how to initialize it with something like:
Thank you!
I searched in Google and here in the forum but can't find any example or tutorial on declaring an array of array and on how to initialize it.
I mean something like
B4X:
((Int, Int), (Int, Int), (Int, Int), ...)
I started from the idea of an array of custom type:
B4X:
Type Coord(x as int, y as int)
Dim arr() as Coord
This could be ok, but I need to manually initialize it with something like (in pseudo-Java code):
B4X:
arr = Array of Coord(new Coord(1,4), new Coord(5,6), ...)
Is it possible to write something like this in B4A?
Otherwise, an array of array of two int could be ok, but I don't know how to initialize it, and even how to correctly declare it. Possibly something like:
B4X:
Dim arr(Array(2) as Int) as ???
I wrote the code up there since it didn't give me syntax error!
And then, how to initialize it with something like:
B4X:
arr = Array as ???((1,4),(5,6),...)
Thank you!