I'm trying to ReDim an array of classes in this line here:
For i As Integer = 0 To RacerList(i).CompatibilityArr.Count - 1
For o As Integer = 0 To RacerList(i).CompatibilityArr.Count - 1
ReDim Preserve RacerList(i).CompatibilityArr(o).HeightCompArr(AmountOfRacers - 1)
Next
Next
The Redim line of code results in "Object Reference not set to an instance of an object."
Above this line of code, I've got:
For i As Integer = 0 To RacerList.Count - 1
ReDim Preserve RacerList(i).CompatibilityArr(AmountOfRacers - 1)
Next
Which works perfectly fine, so I'm pretty sure that the error is in HeightCompArr (also, when I write "HeightCompArr." it does not suggest the children inside of it in the drop down menu)
Below is all of the classes/structures/arrays that are on a separate module form:
Public RacerList As New List(Of Racer)
<Serializable()> Public Class Racer
Public Property Name As String
Public Property CleatSize As String
Public Property SkillLevel As String
Public Property Height As String
Public Property Team As String
Public CompatibilityArr() As Compatibility
End Class
<Serializable()> Public Class Compatibility
Public HeightCompArr() As HeightComp
End Class
<Serializable()> Public Class HeightComp
Public Name As String
Public Score As Integer
End Class
I'm not sure if this is a problem with just how I am containing arrays inside of arrays or what. I am hugely thankful for any advice.