Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cloning an Object
Message
From
14/11/2000 21:15:10
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00441460
Message ID:
00441944
Views:
7
>I want to generically clone any object on a form on to a second (child) form conditionally at run time. Since the object is not a class I cannot use "AddObject', and since I want to do it at RunTime, I cannot use 'CloneObject'
>I can copy all it's properties using a Loop, but not it's methods.

Considering how VFP's containership works with forms, I don't think you can do what you want in a pure sense. The closest I can see is to AddObject an empty member from the same base class, and then transfer the property values. This probably isn't adequate, unless your needs are fairly simple. Also, are you expecting after the child window closes, that any changes to the clone are reflected back on the object in the parent form? That would be harder still, since you could re-transfer some properties, but the sequencing of events and methods would be near impossible to simulate.

Good luck. Maybe if you describe what you're trying to accomplish, someone will have a different idea.

-- Randy
Previous
Reply
Map
View

Click here to load this message in the networking platform