mardi 4 août 2015

Syntax error in custom function

I'm getting a syntax error in the first line of the following code. I'm using array function parameters as shown in MSDN. After removing the brackets from String() the error disappears, but I need an array of strings. My code so far:

Private Function Contains(name As String, names As String()) As Boolean
Contains = False

Dim Index As Integer
For Index = 0 To names.GetUpperBound(0)
    If str = name Then
        Contains = True
        Exit For
    End If
Next
End Function



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire