Using a structure as elements of a jagged array

  • Thread starter Thread starter Bernie Ok
  • Start date Start date
B

Bernie Ok

Guest
Hi folks,

with the following code I get an error as shown in the picture. Can anyone suggest how to avoid getting the NullReferenceExceptioError. Thanks Bernie


Private Structure NNode
Dim NodeValue As Single
Dim Wieghts() As Single
End Structure

Sub example()
Dim Nodes(3)() As NNode
Nodes(0)(0).NodeValue = 5
Nodes(0)(0).Wieghts = {0.3, 0.5}
End Sub

And I get the following error:

Any suggestions AAa


1487481.png


Bernie

Continue reading...
 
Back
Top