G
Guest
Is it possible to make a function return a multidimensional array? I can make
my function return an array, but I can't use the index to return the values
(e.g. MyMultiArray(1, 2)).
Here's my attempt:
Public Function LkpArray()
Dim strLkpMatrix(6, 2) As String
strLkpMatrix(0, 0) = "Lv1"
strLkpMatrix(0, 1) = "Level 1"
strLkpMatrix(0, 2) = "I1CLS"
strLkpMatrix(1, 0) = "Lv2"
strLkpMatrix(1, 1) = "Level 2"
strLkpMatrix(1, 2) = "I1DIV"
strLkpMatrix(2, 0) = "Lv3"
strLkpMatrix(2, 1) = "Level 3"
strLkpMatrix(2, 2) = "I1GRP"
strLkpMatrix(3, 0) = "Lv4"
strLkpMatrix(3, 1) = "Level 4"
strLkpMatrix(3, 2) = "I1CAT"
strLkpMatrix(4, 0) = "Lv5"
strLkpMatrix(4, 1) = "Level 5"
strLkpMatrix(4, 2) = "I1SCT"
strLkpMatrix(5, 0) = "Bind"
strLkpMatrix(5, 1) = "Binding"
strLkpMatrix(6, 0) = "Impt"
strLkpMatrix(6, 1) = "Imprint"
strLkpMatrix(6, 2) = "I1BRNC"
LkpArray = strLkpMatrix()
End Function
my function return an array, but I can't use the index to return the values
(e.g. MyMultiArray(1, 2)).
Here's my attempt:
Public Function LkpArray()
Dim strLkpMatrix(6, 2) As String
strLkpMatrix(0, 0) = "Lv1"
strLkpMatrix(0, 1) = "Level 1"
strLkpMatrix(0, 2) = "I1CLS"
strLkpMatrix(1, 0) = "Lv2"
strLkpMatrix(1, 1) = "Level 2"
strLkpMatrix(1, 2) = "I1DIV"
strLkpMatrix(2, 0) = "Lv3"
strLkpMatrix(2, 1) = "Level 3"
strLkpMatrix(2, 2) = "I1GRP"
strLkpMatrix(3, 0) = "Lv4"
strLkpMatrix(3, 1) = "Level 4"
strLkpMatrix(3, 2) = "I1CAT"
strLkpMatrix(4, 0) = "Lv5"
strLkpMatrix(4, 1) = "Level 5"
strLkpMatrix(4, 2) = "I1SCT"
strLkpMatrix(5, 0) = "Bind"
strLkpMatrix(5, 1) = "Binding"
strLkpMatrix(6, 0) = "Impt"
strLkpMatrix(6, 1) = "Imprint"
strLkpMatrix(6, 2) = "I1BRNC"
LkpArray = strLkpMatrix()
End Function