I'm trying to create a class that uses an array as a property, but I can't get it to work. I've tried doing this like 3 completely different ways and they all yield the same error. The first line of code generating the error is
.question(0) = "abc"
. Please help.
Module mod1
Class test
Public questioncount As Byte
Private mstrQuestion As String()
Public Property question() As String()
Get
Return mstrQuestion
End Get
Set(ByVal value As String())
mstrQuestion = value
End Set
End Property
End Class
Public genericTest As New test
Public Sub setTests()
With genericTest
.questioncount = 3
.question(0) = "abc"
.question(1) = "abcd"
.question(3) = "abcde"
End With
End Sub
End Module