Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy an Object
Message
 
 
À
15/07/2006 18:49:14
John Tomblin
Service Station Systems, Inc.
San Jose, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01136724
Message ID:
01136786
Vues:
15
John,

>How can I make an independant copy of Object1?

You can't. And usually you can't rely on a copy behaving the exact same way when you consider the code behind the object: _access, _assign methods, conditional Init() code or issues like hidden/private scoped properties, internal subobjects. All these things greatly impact the ability to copy an object.

Honestly in all the time I've been working with VFP I've never had to copy an object outside the scope of an academic exercise. What exactly are you wanting to accomplish with a copy of an object?

If you have very simplistic objects you can propogate the property values from one object to another by using amembers() to get the names of the properties, and getpem() to determine if the property is writeable and then addproperty() to assign the property value to the copy.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform