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 
Return to the default flat view Create a new topic Submit Reply
Re: Conflicting Data structures [message #16068 is a reply to message #15933] Tue, 29 June 1999 00:00 Go to previous messageGo 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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
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: Fri Oct 10 16:54:56 PDT 2025

Total time taken to generate the page: 1.27980 seconds