Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to copy an object
Message
De
30/10/1998 05:36:20
James Beerbower
James Beerbower Enterprises
Hochheim Am Main, Allemagne
 
 
À
30/10/1998 05:31:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00152644
Message ID:
00152648
Vues:
26
>>Is there some easy way to copy an object? Like ACOPY() but for objects? Simple assignment creates a reference to the object rather than an new instantiantion.
>>
>>Thanks in advance
>>
>>James Beerbower
>
>Maybe
>oObjectCopy = CREATEOBJECT(oOriginalObject.Class)
Unfortunately that create a new object with the default properties of the class not the properties of the original object:

oa = createobject('x')
oa.x = 'r'
ob = createobject(oa.class)
?ob.x
?oa.x

define class x as custom
x = 'd'
enddefine

But thanks anyways!

James Beerbower
Qsys
Deutschland
James Beerbower
James Beerbower Enterprises
Frankfurt, Deutschland
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform