deepak_warrier
October 13th, 1999, 06:18 AM
I am not able to pass classes to other classes.
In Class1, put the code
public A as Byte
In Form1, put the code
private Sub Form_Load()
Dim X as new Class1
Dim Coll as new Collection
X.A=25
Coll.Add X
'BookMark1
X.A=6
Coll.Add X
End Sub
When I make "X.A=6", the value of the first item in the collection also becomes "6". So, at BookMark1, I added the statement "Set X=Nothing". Is that necessary, or have I made a mistake somewhere? I have the same problem whenever I pass Objects to another Object.
Deepak
In Class1, put the code
public A as Byte
In Form1, put the code
private Sub Form_Load()
Dim X as new Class1
Dim Coll as new Collection
X.A=25
Coll.Add X
'BookMark1
X.A=6
Coll.Add X
End Sub
When I make "X.A=6", the value of the first item in the collection also becomes "6". So, at BookMark1, I added the statement "Set X=Nothing". Is that necessary, or have I made a mistake somewhere? I have the same problem whenever I pass Objects to another Object.
Deepak