What do you mean, “the value of the Nodes property is changed”. In what way? You’re setting the Nodes property to the value of whatever “i” is just before the Add call. What does it become, and how do you determine that?
I found today that the array is growing, as it should with the .add
However, what I found is that the value of ALL of the array elements change to the last value.
So if it is set to a 0, then a 1, then a 2 in the end, ALL of their values are 2. I do not understand this.
Here’s the code. Note the remarked lines are try’s that I did to try to figure this out before posting! Note that clsLassoContents has only one property .nodes.
Appreciate any ideas all!
Dim NodesLassoedCount As Integer = 0
Dim Lassoed As new clsLassoContents
// Clean up all/any existing Nodes_Lassoed arrays
For n as integer = 0 to nodes_Lassoed.Ubound
dim t as integer = 0
For i as Integer = 0 to nodes.LastIndex
If nodes(i).y > SelectionY AND nodes(i).x > SelectionX Then // Check for the top and left of each unit object to be sure inside the lasso
If nodes(i).y + nodes(i).Width < Y AND nodes(i).x + nodes(i).Height < X Then // Check the bottom and left side to be sure inside the lasso
// Lassoed.Nodes = Nodes(i).id
Lassoed.Nodes = t
// nodes_Lassoed.ResizeTo NodesLassoedCount
// NodesLassoedCount = NodesLassoedCount +1
// nodes_Lassoed(NodesLassoedCount).Nodes = nodes(i).id
t = t + 1
NodesLassoedCount = NodesLassoedCount +1