Goodmorning everybody :)
I've a doubt about how Collections kept the data you add to. My questions are from this simple code:
My expectancy was the MsgBox returns 'Hello' while it gets back 'Ciao', such as I've overwrite the value of cls property.
What's happened?
It's very important for to solve and I hope someone can help me.
:wave:
I've a doubt about how Collections kept the data you add to. My questions are from this simple code:
Code:
Dim c As New Collection
Dim cls As New Class1 <- Class1 is a class module within a public var 's' declared as string
cls.s = "Hello"
c.Add cls
cls.s = "Ciao"
c.Add cls
MsgBox c(1).s
What's happened?
It's very important for to solve and I hope someone can help me.
:wave: