Hello
Am having trouble accessing members of structures that are in an array. My app will be receiving several strings of information that will each be subdivided and the info contained within categorized in structures. The number of strings is unknown (but average around 5-10). Each string will be put into an index of the array. The strings will then be split up into smaller strings (of an unknown number, not more than 10) and the smaller strings will be dissected into bits of info and housed in it's own Structure. Although not reflected in the code below, there will be variables to receive the yet unknown numbers (of strings and sub strings), all discovered during a For Loop (hence all of the redim(s)).
Although I am reasonably comfortable working with structures and simple arrays, I can't seem to access the members of the structures to assign them value. I have also posted a jpg to illustrate that the tree I am building appears (to me) to be working. Can someone suggest a line that would allow me to assign theDetails(0).name inside the array theList(0) a string?
Thanks
![Name: local.jpg
Views: 1
Size: 66.0 KB]()
Am having trouble accessing members of structures that are in an array. My app will be receiving several strings of information that will each be subdivided and the info contained within categorized in structures. The number of strings is unknown (but average around 5-10). Each string will be put into an index of the array. The strings will then be split up into smaller strings (of an unknown number, not more than 10) and the smaller strings will be dissected into bits of info and housed in it's own Structure. Although not reflected in the code below, there will be variables to receive the yet unknown numbers (of strings and sub strings), all discovered during a For Loop (hence all of the redim(s)).
Although I am reasonably comfortable working with structures and simple arrays, I can't seem to access the members of the structures to assign them value. I have also posted a jpg to illustrate that the tree I am building appears (to me) to be working. Can someone suggest a line that would allow me to assign theDetails(0).name inside the array theList(0) a string?
Thanks
Code:
Public Class Form1
Public Structure details
Dim name As String
Dim xLoc As Integer
Dim yLoc As Integer
End Structure
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim theList() As Array
ReDim theList(3)
With theList(0)
Dim theDetails() As details
ReDim theDetails(2)
theList(0) = theDetails
End With
With theList(1)
Dim theDetails() As details
ReDim theDetails(1)
theList(1) = theDetails
End With
End Sub
End Class