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

Home » Public Forums » archive » Copying IDL 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
Copying IDL objects [message #12981] Wed, 30 September 1998 00:00 Go to previous message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
I am trying to figure out how to make a copy of an instance of an IDL object.

a = obj_new('myobj')
b = a
; This does not do what I want, it makes a new reference to the same instance

b = obj_copy(a) ; This is what I want

The only way I can see how to do it is:

pro my_obj::copy, out
out->set_a, self.a
out->set_b, self.b
....
end

This means I have to write a set_X function for each field, and each object
class needs its own version of the ::copy routine. This seems crazy.

I seem to recall a post from a few months ago about some ways of generally
getting/setting properties in IDL objects. Any ideas?

____________________________________________________________
Mark Rivers (773) 702-2279 (office)
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is this a bug?
Next Topic: Re: IDL messes up Julian day plots ?

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

Current Time: Sat Oct 11 07:12:37 PDT 2025

Total time taken to generate the page: 0.87482 seconds