[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Copying objects
J.D. Smith (jdsmith@astro.cornell.edu) writes:
> The easiest way to copy objects in bulk, composited objects and all, is to save
> and restore, using:
>
> save,obj,FILENAME=savefile
> restore,savefile,RESTORED_OBJECTS=newobj,/RELAXED_STRUCTURE_ASSIGNMENT
> newobj=newobj[0]
>
> Don't forget that the object reference variable is also restored, and will
> overwrite a variable with the same name in that level (but this can be used to
> advantage -- see below). Also beware of later restoring objects, since their
> methods (and those of their superclasses) will be unavailable, and will not be
> located automatically. You can prevent this... see a posting from last year on
> restoring objects (I can re-post my resolve_obj if necessary).
The lightly edited conversation JD refers to on the
newsgroup about restoring objects can be found here:
http://www.dfanning.com/tips/saved_objects.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155