V
Vasilis X
Hello.
Here is the situation I am facing.
I have 2 collections, A and B. Both have various elements (string type) in
them.
I want to reset them, empty all elements from these collections. I do this
by typing :
Dim Empty as new Collection
A=Empty
B=Empty
At first this works ok and both A and B are empty.
But...
when I add an element to collection B it is also added to collection A, eg
B.add ("Testing element")
will produce as a result A.Count=1 instead of 0.
Why is this happening?
Is it because with the commands A=x, B=x both A and B refer to the same
position of memory that holds values of x ?
Please help and if possible clarify this.
Thanks in advance
Vasilis.
Here is the situation I am facing.
I have 2 collections, A and B. Both have various elements (string type) in
them.
I want to reset them, empty all elements from these collections. I do this
by typing :
Dim Empty as new Collection
A=Empty
B=Empty
At first this works ok and both A and B are empty.
But...
when I add an element to collection B it is also added to collection A, eg
B.add ("Testing element")
will produce as a result A.Count=1 instead of 0.
Why is this happening?
Is it because with the commands A=x, B=x both A and B refer to the same
position of memory that holds values of x ?
Please help and if possible clarify this.
Thanks in advance
Vasilis.