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

Home » Public Forums » archive » Re: help with structure
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: help with structure [message #70291 is a reply to message #70290] Wed, 31 March 2010 15:42 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
Oh, wait, maybe this is what you mean:

IDL> print, *a[25].field
5

Yes, I can see how that could be a problem.

Cheers,

David

> pp writes:
>
>> I suppose he means that by doing that, after the replicate(), all
>> elements of a point to the same two heap variables.
>
> I guess I don't follow you. Isn't this the meaning
> of "replicate"?
>
>> There is no way
>> around it, he needs to loop on the elements to set the pointer on each
>> one to point to something new.
>
> Well, yes, but what else would he be doing?
>
> Perhaps you (and he) mean to replicate a valid pointer
> that points to nothing yet:
>
> IDL> struct ={field:Ptr_New(/ALLOCATE_HEAP)}
> IDL> a = Replicate(struct, 100)
> IDL> Print, Ptr_Valid(a[50].field)
> 1
> IDL> *a[50].field = 5
>
> Just confused, I guess. :-(
>
> Cheers,
>
> David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: help with structure
Next Topic: Re: gripe about structures

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

Current Time: Sun Oct 12 01:11:44 PDT 2025

Total time taken to generate the page: 0.64524 seconds