Z
Zvi Danovich
Hi all,
I am newby in VB.NET (but have good experience in C++), and hope that my
question is very simple for experienced VB user.
The problem is:
Suppose I have the
class A
Dim x as integer
Dim y as integer
end class
and iArrayList having many instances of A.
In my VB.NET code I want assign one of members of ArrayList to some new
instance of A:
Dim iA as new A
iA = iArrayList(5)
In this case I see, that the iA is the REFERENCE to iArrayList(5): if I
write
iA.x = 18
I see, that after this action iArrayList(5).x appears to be 18 too !
But my goal is assignment of the VALUE of iArrayList(5) to iA, NOT reference
(pointer) !
When I write
iA.x = iArrayList(5).y
iA.y = iArrayList(5).y
I get what I want, i.e. by this way I do get the value assignment, but this
is not a good solution.
I am sure, that there is a correct way in VB.NET to assign one instance to
another without the list of assignments of all class members.
Thank you for advance,
Zvi
I am newby in VB.NET (but have good experience in C++), and hope that my
question is very simple for experienced VB user.
The problem is:
Suppose I have the
class A
Dim x as integer
Dim y as integer
end class
and iArrayList having many instances of A.
In my VB.NET code I want assign one of members of ArrayList to some new
instance of A:
Dim iA as new A
iA = iArrayList(5)
In this case I see, that the iA is the REFERENCE to iArrayList(5): if I
write
iA.x = 18
I see, that after this action iArrayList(5).x appears to be 18 too !
But my goal is assignment of the VALUE of iArrayList(5) to iA, NOT reference
(pointer) !
When I write
iA.x = iArrayList(5).y
iA.y = iArrayList(5).y
I get what I want, i.e. by this way I do get the value assignment, but this
is not a good solution.
I am sure, that there is a correct way in VB.NET to assign one instance to
another without the list of assignments of all class members.
Thank you for advance,
Zvi