我在这里做错了什么?数组参数必须是ByRef
Sub Main()
Dim patients() As String
' Some code to populate the patients array, works fine
CalculateScores (patients) ' Array argument must be ByRef compile error
End Sub
Sub CalculateScores(patients As String)
End Sub
如果我改变患者的主要变量数组和CalculateScores的正常工作的参数,但我看不出不能够传递一个字符串的逻辑。默认情况下它是ByRef,所以我知道我错过了一些东西。
我可以肯定地使用一个变体,但感觉哈克。
“患者”参数不适合初学者。 – Comintern
如果这是一个错误的问题,你只需要[删除parens](http://stackoverflow.com/documentation/vba/1179/procedure-calls/3818/this-is-confusing-why-not-just CalculateScores'调用:'CalculateScores patients'' – Comintern
为了阐明@Comintern说的话,'CalculateScores'需要一个真正的String,而不是一个字符串数组。 – R3uK