Hi
I have a class which just holds strings which im pulling out of a xml file, some of these string are list(of string), im using the basic property get/set thats provided when you start coding them.
the get part is just returning the whole list, the set part is using the value variable to add an item
if i write some code like this
it adds an item to the list , so my question is (sound obvious but ill ask), does the Get statement return ByRef?
i just stumbled on this because i forgot how i did the property and just tried this to see what would happen.
Ive changed it to how it should be (Var.mylist = "String") but im just curious why this also worked
I have a class which just holds strings which im pulling out of a xml file, some of these string are list(of string), im using the basic property get/set thats provided when you start coding them.
the get part is just returning the whole list, the set part is using the value variable to add an item
Code:
Get
return mylistEnd Get
Set(ByVal value)
mylist.add(value)End Set
Code:
dim Var as New MyClass
CType(Var.mylist, List(Of String)).Add("NewString")
i just stumbled on this because i forgot how i did the property and just tried this to see what would happen.
Ive changed it to how it should be (Var.mylist = "String") but im just curious why this also worked