= #JxnPortable/docs/programmer_examples/demos/MultiDimensionalArrayDemo.jxn

! create multidimensional 6x8 int array:
iaa = { { 0 : 7 }, { 10 : 17 }, { 20 : 27 }, { 30 : 37 }, { 40 : 47 }, { 50 : 57 } }
 = { [I@91993f, [I@4af82c, [I@ac736f, [I@265ba4, [I@16643d4, [I@19619aa } (int[6][])
!
! access array element:
iaa[2][3]
 = 23 (int)
! row vector:
iaa[2]
 = { 20, 21, 22, 23, 24, 25, 26, 27 } (int[8])
! column vector:
JxnLoop.fill( $this, "$i", { 0 : length iaa - 1 }, "iaa[$i][3];" )
 = { 3, 13, 23, 33, 43, 53 } (int[6])
!
! sub row:
iaa[2][1:4]
 = { 21, 22, 23, 24 } (int[4])
iaa[2][4:1]  ! reverse order
 = { 24, 23, 22, 21 } (int[4])
! sub column:
iaa[1:4][2]  ! wrong: returns element [2] of rows-subarray [1:4] => row [3]
 = { 30, 31, 32, 33, 34, 35, 36, 37 } (int[8])
JxnLoop.fill( $this, "$i", {1:4}, "iaa[$i][2];" )  ! workaround => sub column [2]
 = { 12, 22, 32, 42 } (int[4])
!
! sub matrix:
a3x4 = JxnLoop.fill( $this, "$i", {1:3}, "iaa[$i][2:5];" )
 = { [I@4038d0, [I@80a178, [I@1def03a } (int[3][])
format a3x4
 = { { 12,
 =     13,
 =     14,
 =     15 } (int[4]),
 =   { 22,
 =     23,
 =     24,
 =     25 } (int[4]),
 =   { 32,
 =     33,
 =     34,
 =     35 } (int[4]) } (int[3][]) (java.lang.String)
! sub matrix (transposed):
a4x3 = JxnLoop.fill( $this, "$j", {2:5}, "JxnLoop.fill( $this, \"$i\", {1:3}, \"iaa[$i][$j];\");" )
 = { [I@122cdd0, [I@81f4dc, [I@1ae6ba4, [I@1591d15 } (int[4][])
format a4x3
 = { { 12,
 =     22,
 =     32 } (int[3]),
 =   { 13,
 =     23,
 =     33 } (int[3]),
 =   { 14,
 =     24,
 =     34 } (int[3]),
 =   { 15,
 =     25,
 =     35 } (int[3]) } (int[4][]) (java.lang.String)