I've been searching the internet, books, eBooks and the forum for quite a while now and I haven't found the solution to this problem.
So, I need to create a structure with array elements and then I need to create an array of these structures.
- Code: Select all
Structure infoSwimmer
Dim name As String
Dim grades(7) As Single <--- Error, one cannot initialize array size inside Structures for some reason
Dim average As Single
Dim rank As Single
End Structure
Dim swimmer(9) As infoSwimmer
ReDim preserve swimmer.grades(7) <-- Error because ReDim cannot be used outside a Sub.
Sub Main()
ReDim Preserve swimmer(9).grades(7)
swimmer(0).grades(0) = 5 <--- NullReferenceException error, so basicly the code above didn't redimensioned anything. And even if it did, the new ReDimensioned array would only be visible inside the Main(), right?
End Sub
So I ask, how can I create a global array of structures with array elements inside of it?
Much appreciated for any help,
Amoguai


