Click to See Complete Forum and Search --> : Copy User defined type


Step
October 18th, 2001, 08:10 AM
Hello, i have got an user defined type and would like to copy it into another type. I would like to have a copy and not a reference! Has anybody got a solution?
Type Address1
Name
Age
End Type

Dim Address1 As Address
Dim Address2 As Address

Address1.Name = A
Address1.Age = 2

Address2=Address1

If I now change the name of Address2 the name of Address1 changes, too (byref).
I would like to have a copy!
Thanks

Boumxyz2
October 18th, 2001, 08:40 AM
instead of using Equal you might want to do a class with the user defined type and add a method copy..

It should work that way. that copy returns a New object of that type.

Or you may wanna try this

Address2.Name = Address1.name
Address2.Age = Address1.Age