Quantcast
Viewing all articles
Browse latest Browse all 27078

VS 2010 Structures with Arrays

I am having a hard time understanding how VB 2010 wants me to go about declare a variable size inside a structure. I am used to VB6 and trying to learn VB 2010, but the books I have bought tell me nothing about structures.

In VB6 I could define a custom variable type as such:
Type PolygonType
Dim numberSides as Integer
Dim Length(20) as Integer
Dim Area as Integer
Dim Circumference as Integer
End Type

Now with structures I cannot declare the variable size. For my project I have a structure for a tournament information in my module1.

Structure TournType
Dim Name As String
Dim NumDays As Integer
Dim TournDate() As Date
Dim NumFields As Integer
Dim FieldName() As String
Dim GroupEnabled() As Boolean
Dim DefaultGameLen() As Integer
Dim StartTime As Integer
Dim NumGames As Integer
Dim NumRefs As Integer
Dim NumTeams As Integer
End Structure

Then I create a public variable

Public TournInfo As TournType

So how am I supposed to tell VB how large the arrays TournDate, FieldName, GroupEnabled and DefaultGameLen should be? Thank you.

Viewing all articles
Browse latest Browse all 27078

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>