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

Home » Public Forums » archive » 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: Structures [message #42917 is a reply to message #23873] Tue, 01 March 2005 16:21 Go to previous messageGo to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
Michael Wallace <mwallace.no.spam@no.spam.swri.edu.invalid> wrote:
> I learned all this the hard way by trying to figure out why I kept
> getting errors when I'd attempt to use a different array size for some
> of my structure variables. I finally ran across this in the IDL
> documentation, but there wasn't any actual reason given for such
> draconian policy, especially when compared to the rest of the language.

I *think* it's something along these lines: We want to be able to
create arrays of structs, which (from a language designer's
viewpoint!) is much, much easier when all the structs are the same
size. If you let array sizes inside of structs vary, then you might
have foo1.somearray with 10 elements, and foo2.somearray with 100.
Then when the user does bar = [foo1,foo2], suddenly you're dealing
with an array of heterogenous data types and memory access becomes a
whole lot uglier and more inefficient. At that point, it's probably
easiest just to switch to Perl. ;-)

> It's really not a big deal since I can create anonymous structs
> everywhere instead of using named structures. Do named structures

You can also create named structures containing pointers to arrays, too.
This very problem is what finally pushed me over the potential barrier
into learning how to do pointers in IDL!

- Marshall
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: catch and I/O errors
Next Topic: object widgets

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

Current Time: Wed Oct 08 15:26:25 PDT 2025

Total time taken to generate the page: 0.10874 seconds