by the way another way of doing it would be to join the elements of the array together with vbNullChar's then send it to your fuinction, then in the function split them again...that would solve your problem...thats how most of the API does it
Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."
calling a sub including the ( and ) surrounding its parameters forces by val which is why is shows you an error, remove the surrounding ( )'s and you are ok...
also replace the (1) with (i) in the loop...
i have highlighted the code that i have changed....
VB Code:
Option Explicit
Private Sub Form_Load()
Dim ar(0 To 10) As String
Dim i As Integer
For i = 0 To 10
'ar(1) = i - INCORRECT
[b]ar(i) = i[/b] ' - CORRECT
Next i
'Test (ar) - INCORRECT
[b]Test ar[/b] ' - CORRECT
End Sub
Public Sub Test(a() As String)
Dim i As Integer
For i = 0 To 10
MsgBox a(i)
Next i
End Sub
Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."