C
Clive Lumb
Hi,
Being of advancing age and little brain, I can't for the life of me remember
how to add a class to a list without it being simply a reference.
Pseudo code:
MyClass
This Property, ThatProperty
End Class
MainClass
Dim MyList as New List(Of MyClass)
dim TempC as new MyClass
For each set of lines in a file
Do fun stuff and set TempC.ThisProperty and TempC.ThatProperty
MyList.Add(Temp)
Next
MyList ends up containing the correct number of items, but every single one
is the same as the last TempC added.
There must be something glaringly obvious.
Please make me say "D'oh!"
Cheers
Being of advancing age and little brain, I can't for the life of me remember
how to add a class to a list without it being simply a reference.
Pseudo code:
MyClass
This Property, ThatProperty
End Class
MainClass
Dim MyList as New List(Of MyClass)
dim TempC as new MyClass
For each set of lines in a file
Do fun stuff and set TempC.ThisProperty and TempC.ThatProperty
MyList.Add(Temp)
Next
MyList ends up containing the correct number of items, but every single one
is the same as the last TempC added.
There must be something glaringly obvious.
Please make me say "D'oh!"
Cheers