[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Top 10 IDL Requests

Otte Homan (ottehoman@my-deja.com) writes:

> I have the same problem - I'd like to create a
> hierarchical data structure, basically an array,
> of structures (so I can use DataFile(1),
> DataFile(2), etc...) Each structure consists of
> headers, parameters, and *dynamic* arrays. So the
> structures are *more or less* the same, but
> differ in the lenght of their arrays. Using IDL
> 5.3 (sorry, our site has only this
> version licensed) the contents of an array can
> only be of one single type. My filestructures
> are like this: {{header},{parameters},{data}},
> where {data} is a structure with arrays of (from
> file to file) different lengths. I only know at
> runtime how long these arrays are.
> Any solution ?

Well, I reiterate. Pointers. The solution is pointers. :-)

If the data field of this structure is a pointer to
the variable length array, then you can store as many
of these structures in an array as you like.

William asked for an array of different structures,
which sort of turns the definition of an array
topsy-turvy. But *this* problem can be solved with
pointers, I'm sure of it. :-)



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