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

Home » Public Forums » archive » Re: Q: pointers inside of an array of structures?
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: Q: pointers inside of an array of structures? [message #21296] Wed, 16 August 2000 00:00 Go to previous message
Ivan Zimine is currently offline  Ivan Zimine
Messages: 40
Registered: February 1999
Member
Amara Graps wrote:
>
> IDL> thisstruc = {orbit:'', freq:ptr_new()}
> IDL> periodcube = replicate(thisstruc,1)
>
> ;Put values into the structure
> IDL> periodcube(0).orbit='G2'
> IDL> *periodcube(0).freq=DINDGEN(50)
> % Unable to dereference NULL pointer: <POINTER (<NullPointer>)>.
> % Execution halted at: $MAIN$

x = ptr_new() doesn't create a new heap variable so you can't assign
anything to *x

you should try with:

IDL> thisstruc = {orbit:'', freq:ptr_new(/alloc)}

or with some value
IDL> thisstruc = {orbit:'', freq:ptr_new(!values.f_nan)}


Ivan

--
Ivan Zimine | ivan.zimine@physics.unige.ch
Dpt. of Radiology | (+41 22) 372 70 70
Geneva University Hospitals |
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: test (no word wrap), David, please check!
Next Topic: Reverse interpolation?

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

Current Time: Sun Nov 30 06:22:26 PST 2025

Total time taken to generate the page: 0.63699 seconds