Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Copy a Object ??
Message
From
30/08/1999 20:32:22
 
 
To
28/08/1999 10:04:43
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00258802
Message ID:
00259453
Views:
22
Basically, this is impossible to be done safely, because:
1. There may be private/protected properties that you cannot access.
2. There may be accessor methods for some/all properties. While this is not a problem directly, the order you'll use to copy the properties determines the execution order for the accessor methods. The code inside these methods may behave differently depending on the value of other properties, etc, etc. I'm sure you got the idea...

But this can be a good item for the wish list. Before that, try to decide yourself on the following problem: when an object is copied, should the owned objects (properties that hold references to other objects) be copied or linked to the new object. This is the most difficult problem, IMHO. If the objects are copied, you may end with infinite loops and other problems. If the objects are only linked to the new object, you may never know who holds references to what objects and, as you know, this is a very ugly problem in VFP.

Vlad

>x=Thisform
>
>Holds a object reference for that object but how I can make a seperate copy of object...something like..
>
>x=Copyof(Thisform)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform