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

Home » Public Forums » archive » Re: Conflicting Data structures
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: Conflicting Data structures [message #15931] Sun, 27 June 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Dirk Fabian (dirk@uwast.astro.wisc.edu) writes:

> Now! I have a widget that allows a user to select an ascii data file and read
> it into a structure. Lets say widget#2 queries that structure and performs some
> operations based on the data, and then widget#2 is destroyed.
>
> Ideally, i would like the user (me) to be able to choose a new data file, read it
> in, and query it, but i keep get the conflicting data structures error. Even
> if i exit the program and rerun it, it seems like that structure is still hanging
> around. I can't figure out how or where to zero it out! What am i missing?

Any field in a structure that is going to have the type
or size of the information stored there changing from
time to time should be implemented as a pointer. This
is *especially* true for the data fields if you intend to
allow the user to read new data sets.

info = { data: Ptr_New(real_data), ... }

Then, to use the data:

Plot, *info.data

Be sure to destroy the pointer in your CLEANUP routine
when the widget program is destroyed:

Ptr_Free, info.data

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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Crazy use of MAX function.
Next Topic: Re: When should objects be used?

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

Current Time: Wed Oct 08 18:07:36 PDT 2025

Total time taken to generate the page: 0.00538 seconds