Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I copy an object?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00188172
Message ID:
00188173
Views:
19
Well, the 'usual' manner is to have defined a class for the 'Custom' object. Then, to 'copy' it, you need only to MyContainer.AddObject. If you need this new object to possess property changes done to an existing object, I would suppose you would then have to programmatically assign those, like MyContainer.oSecond.Caption = MyContainer.oFirst.Caption, and so on...

Sorry, I don't think there's an easier way (no 'CopyObject' method)

Mark

>I've got a container with an number of Custom objects in it. As I process each object in the container, I may need to create another object in the container which is a copy of one of the existing objects and then change a couple of properties of the new object. When I assign the existing object to the new object, both are referencing the same single object - not separate objects.
>
>How do I create a new object in a container that is a copy of an existing object?
>
>TIA
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.
Previous
Reply
Map
View

Click here to load this message in the networking platform