P
pinkfloydfan
Hi all
Having built an object of a user-defined class and stored it an
element of a public array (all works fine), I now wish to copy that
object to a new element and work on the copy.
For example:
Public StoreObjects(100) as NewClass1
Function CreateCopyClass(OldStoreNumber as integer, NewStoreNumber as
integer)
Set StoreObjects(NewStoreNumber)=StoreObjects(OldStoreNumber)
CreateCopyClass=NewStoreNumber
End Function
The problem is that while the object seems to have been copied over to
the NewStoreNumber, when later I look to manipulate that new object
within the code it also changes the data in the original object.
What am I doing wrong please?
Thanks very much for your help
Lloyd
Having built an object of a user-defined class and stored it an
element of a public array (all works fine), I now wish to copy that
object to a new element and work on the copy.
For example:
Public StoreObjects(100) as NewClass1
Function CreateCopyClass(OldStoreNumber as integer, NewStoreNumber as
integer)
Set StoreObjects(NewStoreNumber)=StoreObjects(OldStoreNumber)
CreateCopyClass=NewStoreNumber
End Function
The problem is that while the object seems to have been copied over to
the NewStoreNumber, when later I look to manipulate that new object
within the code it also changes the data in the original object.
What am I doing wrong please?
Thanks very much for your help
Lloyd