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 #31026 is a reply to message #31025] Thu, 06 June 2002 02:56 Go to previous messageGo to previous message
Randall Skelton is currently offline  Randall Skelton
Messages: 169
Registered: October 2000
Senior Member
On Thu, 6 Jun 2002, Ben Tupper wrote:

>>
>>> What's the command to make b an entirely new object but identical to
>>> a.
> Hello,
>
> In Martin Schultz's MGS_BASEOBJECT there is a COPY method that returns
> a populated object of the same class as the original; the returned new
> object has its own reference id. It's pretty handy for most object
> coding I deal with. It's worth a peek.

I agree with Ben... I too use Martin's copy method and it works very well.
It does have problems when you try and clone a class that has requried
positional parameters though as internally it relies on 'clone = obj_new(
obj_class(self) )'. My 'I do not have time to think about this now'
solution was to make classes with no required positional parameters and
write an 'isValid' method that ensures the object is correctly populated
with 'quasi-required' parameters before it is used. Of course, failing to
use positional arguments for required parameters goes against some well
established IDL programming conventions and therefore tends to upset some
of the IDL Expert Programmer's Association Executive Committee members ;)
[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 17:28:19 PDT 2025

Total time taken to generate the page: 0.00418 seconds