comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Copying (Duplicating) Objects
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Copying (Duplicating) Objects [message #31154 is a reply to message #31025] Sat, 08 June 2002 11:49 Go to previous message
MKatz843 is currently offline  MKatz843
Messages: 98
Registered: March 2002
Member
Thanks for all the great suggestions. Here's the solution I've cobbled
together. It seems to work nicely.

I now define objects with the following specifications

(1) The GetProperty method has an all=all keyword that
returns a structure containing all of the paramters and
values of that object. (I know this works best when the
values are simple and not pointers and containers...)

(2) The Init method has an all=all keyword. If the user provides
an all structure when the object is first defined, then the
contents are used to set the initial values of the object.

I defined the following obj_copy() function

function obj_copy, a
a -> GetProperty, all=all ;Read a structure with all prameters
b = obj_new(obj_class(a), all=all) ;Create new identical object
return, b
end

While not a completely generalizable function, this will work for me
for now.
I also like the suggestion to make a Copy() method part of all object
definitions.

M. Katz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: VIP, Julday
Next Topic: Re: Multiple PS-files?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:32:54 PDT 2025

Total time taken to generate the page: 0.00535 seconds