Quote:
Originally Posted by Cableguy
Since B4A still hasn't 2D arrays
|
Actually it does. You can have as many dimensions as you need, or at least as many as your brain can cope with.
Dim AnArray(1,2,3 ...) As Whatever
For sorting use a List. You can add an array directly to a List.
Dim A() As Int
A = Array As Int(5, 7, 1, 2, 9, 2)
Dim L As List
L.Initialize
L.AddAll(A)
L.Sort(True)
You can actually use an array anywhere where a List can be used as Basic4android will convert it for you, but not unfortunately the other way round. I don't think there is a quick way to convert from a List to an array except by doing it item by item within a For loop.
EDIT :- Corrected the stupid use of Add instead of AddAll in the original code fragment.