Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Copy a Object ??
Message
From
01/09/1999 10:19:54
 
 
To
31/08/1999 19:58:14
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00258802
Message ID:
00260151
Views:
15
>>x=createobject('form')
>>y=createobject(x.class)
>
>It only creates an object of the same class, not a copy of the initial object.
>
>Vlad

From here you can use GetPEM() and AMEMBERS() to copy the object Properties. What if the object contains objects? I assume you want to copy those too...

One thing you could do is get Rick Strahls wwXML class which has an ObjectToXML method, which takes the object and puts it into XML... then, use the XMLToObject to build the copied object. I believe his class will also walk contained classes optionally...

So, if you have a form you want to copy, do you also want to addobject all the controls to the copy?

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform