How does one resize an array within property methods in vb.net?
Here's how I tried to approach the situation:
'Declare Name Array Property
Public Property Name(ByVal index As Integer) As String
Get
index = nStudents
Return _Name(index)
End Get
Set(value As String)
End Set
End Property
'Declare Dishes Array Property
Public Property Dishes(ByVal index As Integer) As Integer
Get
Return _Dishes(index)
End Get
Set(value As Integer)
End Set
End Property
Public Sub New() 'Resize _Name And _Dishes Arrays
ReDim _Name(nStudents)
ReDim _Dishes(CInt(nStudents))
End Sub
Written by Tats
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vb.net
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#