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

Home » Public Forums » archive » Re: arrays within 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: arrays within structures [message #14931] Mon, 12 April 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Waleed (114566.43@CompuServe.COM) writes:

> Is it possible to reduce the size of an array within a structure?

Depends on what kind of a structure it is. If it is an
anonymous structure then something like this is possible:

struct = { a:5, b:Bytarr(100,100)}
struct = {a:struct.a, b:BytArr(50,50)}

But in general it is MUCH better programming practice to
make fields that will change in structures pointers. That
way you don't have to re-define the structure and you can
store whatever you like at the pointer location:

struct = { a:5, b:Ptr_New(BytArr(100,100))}
*struct.b = BytArr(50,50)

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
Previous Topic: Fortran External Calls
Next Topic: Re: Re-setting null values for compound button widget

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

Current Time: Fri Oct 10 06:37:24 PDT 2025

Total time taken to generate the page: 0.35595 seconds