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

Home » Public Forums » archive » 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
Conflicting Data structures [message #15933] Sun, 27 June 1999 00:00 Go to next message
dirk is currently offline  dirk
Messages: 15
Registered: March 1998
Junior Member
First off, i want to thank David, Liam, and all the rest who helped me with my
question about how to retain data after a widget has been destroyed. I think i
was partially confused to begin with, but somehow the answers cleared things up
anyway.

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?

Thanks! - dirk
Re: Conflicting Data structures [message #16060 is a reply to message #15933] Wed, 30 June 1999 00:00 Go to previous message
Nando Iavarone is currently offline  Nando Iavarone
Messages: 48
Registered: December 1998
Member
<HTML>
dfabian@my-deja.com wrote:
<BLOCKQUOTE TYPE=CITE>Can anyone tell me what the purpose
<BR>of having a named structure versus an anonymous
<BR>structure might be?&nbsp; It doesn't seem like the
<BR>named structures are as versatile - you certainly
<BR>can't destroy them and re-fill them with new
<BR>information.</BLOCKQUOTE>
A few examples on the use of a non anonymous structure can be found in
the idlhelp.

<P>I'm developing a great system,
<BR>and I think the non anonymous structures are useful&nbsp; from the
point of view of the architectural design.

<P>Have a good job.
<BLOCKQUOTE TYPE=CITE>Sometimes.. i just want to pinch IDL.</BLOCKQUOTE>
So do I&nbsp;&nbsp; ;o)&nbsp;
<PRE>--&nbsp;
Nando Iavarone
Advanced Computer System - SPACE DIVISION
via Lazzaro Belli, 23
00040&nbsp; Frascati - RM
Tel: +39-6-944091 (switchboard)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 9440968 (direct)
E-mail:&nbsp;
&nbsp;&nbsp;&nbsp; f.iavarone@acsys.it
&nbsp;&nbsp;&nbsp; FrdndVrn@altavista.net</PRE>
&nbsp;</HTML>
Re: Conflicting Data structures [message #16068 is a reply to message #15933] Tue, 29 June 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Dirk (dfabian@my-deja.com) writes:

> This was it! I had defined the structure with a
> name (i'm not sure why) and somehow that caused
> the conflict. Can anyone tell me what the purpose
> of having a named structure versus an anonymous
> structure might be?

Named structures are much easier to use sometimes, since
the *definition* of the structure is stored inside of
IDL. So, if I make a structure like this:

a = {EMPLOYEE, name:'', age:0, salary:0.0}

Then, I can get one of those "things" named
EMPLOYEE like this:

b = {EMPLOYEE}

And IDL knows that b is that kind of a structure with
three fields, name, age, and salary and it knows how
those fields are defined. I don't have to reproduce
this information each time I make another EMPLOYEE
structure.

In general, use named structures for structures whose
fields are not likely to ever change. Use anonymous
structures for all the rest.

> It doesn't seem like the
> named structures are as versatile - you certainly
> can't destroy them and re-fill them with new
> information.

Anything that will be changing inside of a structure
should be implemented with a pointer, regardless of
whether you are using Named or Anonymous structures.
If done this way, "re-filling" them is not difficult
at all.

> Sometimes.. i just want to pinch IDL.

Humm. I don't think we want to bring up this subject
in *this* group. Please take this over to alt.comp.fetish. :-(

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
Re: Conflicting Data structures [message #16074 is a reply to message #15933] Tue, 29 June 1999 00:00 Go to previous message
dfabian is currently offline  dfabian
Messages: 1
Registered: June 1999
Junior Member
In article <37778EB0.2CE6EEAA@acsys.it>,
Nando Iavarone <f.iavarone@acsys.it> wrote:
>
> --------------94CC3193604DD96E7DB7AF78
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Dirk Fabian wrote:
>
>> 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?
>
> A few weeks ago I had a "Conflicting Data
structures". I tried to
> redefine a non anonymous structure. I had a file
with an header
> defining its dimension, and I use them to
allocate a structure array.
>

[Example snipped]

> To resolve the problem I had to use an anonymous
struct.
> --
> Nando Iavarone
>

This was it! I had defined the structure with a
name (i'm not sure why) and somehow that caused
the conflict. Can anyone tell me what the purpose
of having a named structure versus an anonymous
structure might be? It doesn't seem like the
named structures are as versatile - you certainly
can't destroy them and re-fill them with new
information.

Thanks much, Dirk

Sometimes.. i just want to pinch IDL.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Re: Conflicting Data structures [message #16116 is a reply to message #15933] Mon, 28 June 1999 00:00 Go to previous message
Nando Iavarone is currently offline  Nando Iavarone
Messages: 48
Registered: December 1998
Member
<HTML>
Dirk Fabian wrote:
<BLOCKQUOTE TYPE=CITE>Ideally, i would like the user (me) to be able to
choose a new data file, read it
<BR>in, and query it, but i keep get the conflicting data structures error.&nbsp;&nbsp;&nbsp;&nbsp;
Even
<BR>if i exit the program and rerun it, it seems like that structure is
still hanging
<BR>around.&nbsp; I can't figure out how or where to zero it out!&nbsp;
What am i missing?</BLOCKQUOTE>
A few weeks ago I had a "Conflicting Data structures". I tried to
<BR>redefine a non anonymous structure. I had a file with an header
<BR>defining its dimension, and I use them to allocate a structure array.

<P>For example:

<P>pro try_struct__define
<BR>&nbsp;&nbsp;&nbsp; n = 5
<BR>&nbsp;&nbsp;&nbsp; struct = {try_struct, $
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
a: findgen(n)}
<BR>end

<P>pro pippo
<BR>&nbsp;&nbsp;&nbsp; a = {try_struct}
<BR>&nbsp;&nbsp;&nbsp; help, /struct, a

<P>&nbsp;&nbsp;&nbsp; n = 6
<BR>&nbsp;&nbsp;&nbsp; b={try_struct, $
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; a: findgen(n)}
<BR>&nbsp;
<BR>&nbsp;&nbsp;&nbsp; help, /struct, b
<BR>end
<BR>&nbsp;

<P>To resolve the problem I had to use an anonymous struct.
<BR>pro pippo
<BR>&nbsp;&nbsp;&nbsp; n = 5
<BR>&nbsp;&nbsp;&nbsp; a = {$
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; a: findgen(n)}
<BR>&nbsp;&nbsp;&nbsp; help, /struct, a
<BR>&nbsp;&nbsp;&nbsp; n = 6
<BR>&nbsp;&nbsp;&nbsp; b={$
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a: findgen(n)}
<BR>&nbsp;&nbsp;&nbsp; a={$
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a: findgen(n)}
<BR>&nbsp;&nbsp;&nbsp; help, /struct, a,b
<BR>end
<PRE>--&nbsp;
Nando Iavarone
Advanced Computer System - SPACE DIVISION
via Lazzaro Belli, 23
00040&nbsp; Frascati - RM
Tel: +39-6-944091 (switchboard)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 9440968 (direct)
E-mail:&nbsp;
&nbsp;&nbsp;&nbsp; f.iavarone@acsys.it
&nbsp;&nbsp;&nbsp; FrdndVrn@altavista.net</PRE>
&nbsp;</HTML>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Sinagular Value in Complex Array
Next Topic: Compiling DLM's using Borland C++ builder

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

Current Time: Wed Oct 08 15:06:03 PDT 2025

Total time taken to generate the page: 0.00720 seconds