这听起来像一个愚蠢的问题,但我对拉听得出来。的Visual Basic 6阵列作为参数
我有一个Sub由此我想分析阵列并将其分配给一个类模块“对象”。
我如何去这样做。
我确实有不工作是:
Private matrix(9,9) As Integer
'The Setter Sub
Public Sub SetMatrixArray(arrValToSet() as Integer)
matrix = arrValToSet
End Sub
'In the caller module/class module I have the following code to parse the array.
Dim theArray(9,9) As Integer
Dim customObj as CustomObject
customObj.SetMatrixArray(theArray)
我收到以下错误信息:
类型不匹配:数组或用户定义类型预期。
Dabblernl的答案应该有效。如果你有更多的问题,[this](http://www.cpearson.com/excel/passingandreturningarrays.htm)似乎是相当不错的一种数组资源(它是关于VBA的,但是这足够接近于有用)。 – 2011-05-18 20:29:54
@ ho1我并不反对,但他调用SetMatrixArray的语法不正确。我正在查看[this](http://msdn.microsoft.com/en-us/library/wcx04ck5(VS.85).aspx)。我错了吗? – 2011-05-18 20:38:38
@Jay:不,我认为你完全正确。我太习惯VB.Net,所以直到现在我才注意到那些额外的括号。我认为你需要结合你和Dabblernl的答案。 – 2011-05-18 20:51:55