Is there any way to copy or clone an object without having to specify each property line by line ?
Julian
Hi,
I am currently out of the office with limited access to voice mail and
email and will be returning on August 2nd. If you need immediate
assistance please contact Jim Stein at jstein@cornerstar.com.
Thanks,
Bryn Dearborn
503-805-8598
--
Bryn Dearborn
503-928-8115 (Work)
503-805-8598 (Cell)
www.cornerstar.com
Is there any way to copy or clone an object without having to specify each property line by line ?
Depends on the implementation of the Clone() method (optional).
Which object are you seeking for? For your own objects you should implement the Clone() method yourself.
I was hoping that you wouldn't say that. I want to create another
instance of an existing object without having to write all the assigns
by myself
I was hoping that you wouldn't say that. I want to create another
instance of an existing object without having to write all the assigns
by myself
No sorry that isn't possible - and probably not desirably. Just duplicating an object would duplicate encapsulation. The class needs to decide the actual state of the copy - or might not even like duplicate (singletons).
Vote for the enhancements discussed here http://communities.progress.com/pcom/thread/27156?tstart=0
WRITE-XML on the source object and a READ-XML to create a new object would be the perfect way to do a clone.
Doesn't help you now, of course. Program generators are good at this sort of thing.