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

Home » Public Forums » archive » Re: Structure field concatenation
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: Structure field concatenation [message #21611 is a reply to message #21609] Thu, 31 August 2000 09:12 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Ben Tupper (pemaquidriver@tidewater.net) writes:

> I know that this has been a subject of some discussion recently... but
> I'm still not on firm footing on the best method of changing the size of
> an anonymous structure's fields (i.e. I want to increase or decrease the
> size of a field). The code below shows an example of how I do it now:
> creating a new structure with the appropriately sized fields. Is there
> a better method?

No, no, no. A "better method!?" Yes, there is a better method. :-)

Here is a new rule for you.

ANY time you have a structure member changing either
size or data type, make that structure member a pointer.

struct = { fish: Ptr_New(runOfTheMillFish), ... }

Later, when something changes:

*struct.fish = sexyNewFish

All you have to do is remember to clean this pointer up
in some kind of cleanup routine, or before you exit the
program. And don't worry about cleaning up memory and
all of that when you make the new assignment. IDL is
going to take care of that for you. Isn't that nice? :-)

You must have taken my class a LONG time ago. It is
this kind of embarrassing nonsense that finally got
me off my duff and writing again. I'll send you a copy
of the new book (due out in September). :-)

> BTW: I don't want to steer the discourse toward a scandalous sidebar
> discussion, but... I'm wrestling with this because a shrimp starts out
> as a male and then ends up as a female a few years later. I'm working
> with a database that has the shrimp broken down into records by sex...
> but I need to add new records for aggregate sex (that is the sum of
> males, transitionals, females,...) I never thought IDL programming
> could be so titillating.

This kind of talk is TOTALLY inappropriate in this newsgroup.
Take it on over to alt.xxx.sex.fetish.fish.

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: Re: NetCDF file object
Next Topic: Gettng a widget screenshot?

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

Current Time: Sat Oct 11 16:02:13 PDT 2025

Total time taken to generate the page: 2.15829 seconds