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
Re: Copying IDL objects [message #13054 is a reply to message #12981] Fri, 02 October 1998 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Hi Folks,

I wrote just a couple of minutes ago:

> This seems like a lot of work. I think I would write this
> function something like this:
>
> PRO My_Obj::Copy, out
> tags = N_Tags(self)
> For j=0,tags-1 DO out.(j} = self.(j)
> END

Mark Rivers kindly points out to me that this doesn't work,
for the simple reason that self is not a structure (even
though it can be accessed as if it were a structure in
a method). Thus, N_Tags returns a 0.

To make it work, I have to do this (with a bit of error
checking too :-):

PRO My_Obj::Copy, out
selfClass = Obj_Class(self)
outClass = Obj_Class(out)
IF selfClass NE outClass THEN BEGIN
ok = Dialog_Message('Object classes not identical.)
RETURN
END
ok = Execute('struct = {' + selfClass + '}')
tags = N_Tags(struct)
For j=0,tags-1 DO out.(j) = self.(j)
END

Cheers,

David

----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[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: Sun Oct 12 22:17:43 PDT 2025

Total time taken to generate the page: 0.00255 seconds