Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicate an object at run time
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00625824
Message ID:
00625833
Vues:
11
Hi,

>Is it possible duplicate an object, including all the object's properties, at run time?

No, that's not possible with a VFP function.

What comes to my mind (I've never done this) is to read the class out of the object, make a CREATEOBJECT() and copy all the properties to the newly created object.

I think this could work for incomplex objects, but be aware of things like aggregated objects (by simply copying property values, a reference to another object would point to the same object in the original object and the cloned objects). There will definately be some more pitfalls.

Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform