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

Home » Public Forums » archive » Re: Duplicate heap variables recursively
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Duplicate heap variables recursively [message #51367] Thu, 16 November 2006 04:13
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
On 16 Nov 2006 03:30:06 -0800, tianyf@gmail.com wrote:

> You can duplicate one exact variable by using REPLICATE.

Yes, but this duplicates pointers too and that is not what I want.


IDL> print,*(*a).p
5
IDL> *(*b).p = 10
IDL> print,*(*a).p
10
-> this must stay 5, not 10.
Re: Duplicate heap variables recursively [message #51368 is a reply to message #51367] Thu, 16 November 2006 03:30 Go to previous message
enod is currently offline  enod
Messages: 41
Registered: November 2004
Member
You can duplicate one exact variable by using REPLICATE.


Tian


Wox wrote:
> Hello,
>
> Is there and easy way of duplicating heap variables recursively (like
> HEAP_FREE does for freeing heap variables).
>
> Something like this (but then with more complicated referencing)
> a=ptr_new({p:ptr_new(5)})
> b=duplicate(a)
> *(*b).p=10
>
> So that *(*a).p == 5 and *(*b).p == 10
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Duplicate heap variables recursively
Next Topic: Re: Partial summation of a data set!

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

Current Time: Wed Oct 08 15:27:07 PDT 2025

Total time taken to generate the page: 0.11330 seconds