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

Home » Public Forums » archive » Re: taming the shrew, a.k.a. 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: taming the shrew, a.k.a. structure [message #26020 is a reply to message #26001] Wed, 01 August 2001 10:48 Go to previous messageGo to previous message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
HILBERMAN writes:
>
> To put it simply, you rock. I have now successfully created a mess: an
> array of a structure
> that contains another embedded structure. Unfortunately, I'm still not
> 'pointed' in the right
> direction. When I try to apply the pointer tip to 'the mess' I get the
> error:
> % Conflicting data structures: <POINTER (<NullPointer>)>,MONTH_STRUCT.
>
> Here's how I have things set up right now.
> month_struct = {month_struct, name: ptr_new( ), day: ptr_new( ), temp_c:
> ptr_new( )}
> station = {station, number:0L, month:{month_struct}}
> po_basin = replicate (station, howmany)
>
> po_basin.month.name = ptr_new( strarr(2190) )
> ...
>
> Any ideas? Since station references a structure with pointers, do I have to
> make a pointer to
> station as well--or something similar? I can't say I know a lick about
> objects, but this is
> kinda seeming like a problem to be solved by an object? Oyvey.

Here is what I tried:

IDL> month_struct = {month_struct, name: ptr_new( ), day: ptr_new(), $
temp_c: Ptr_New()}
IDL> station = {station, number:0L, month:{month_struct}}
IDL> po_basin = replicate (station, 2)
IDL> po_basin.month.name = ptr_new( strarr(2190) )
IDL> *((po_basin)[0].month.name) = 'dad'
IDL> *((po_basin)[1].month.name) = 'mom'

What is the problem!?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL and Beowolf ?
Next Topic: Re: polar contour plots

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

Current Time: Wed Oct 08 18:44:12 PDT 2025

Total time taken to generate the page: 0.01380 seconds