Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy an Object
Message
 
 
To
15/07/2006 18:49:14
John Tomblin
Service Station Systems, Inc.
San Jose, California, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01136724
Message ID:
01136786
Views:
14
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform