Multidimensional arrays can be understood as "arrays of arrays", with more "dimension" concepts than one-dimensional arrays. You can use multidimensional arrays to record complex information. For example, to track every pixel on a computer screen, you need to reference its x, y coordinates, and you should store the values in a multidimensional array.
VB.net declares the syntax for multidimensional arrays as follows:
Dim arrayname (Varnumber1,varnumber2,......, varnumbern) as Type
You can extend all the rules of a one-dimensional array to more than two dimensions of multidimensional arrays. For example, the following statement declares a two-dimensional array of 10x10 and a three-dimensional array of 4x10x15:
Dim Matrixa (10,10) as Double
Dim Multid (4,10,15) as single
The total number of elements is the product of the dimensions of each dimension, that is, 100, 600.
Note: When you increase the number of dimensions in an array, the storage space occupied by the array increases dramatically, with all the multidimensional arrays to be used with caution. Use the "Object" array with extra care because they require more storage space. An array of loops can be nested with a "for" loop to efficiently process multidimensional arrays. For example, in "Matrixa", it assigns values based on the position of each element in the array:
Dim i,j As Integer
Dim Matrixa (10,10) as Double for
i=0 to 9 for j=0 to
9
Matrixa (i,j) =i*10+j
>next