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

Home » Public Forums » archive » Re: Need prog to give size of a structure in bytes
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: Need prog to give size of a structure in bytes [message #13643 is a reply to message #13638] Fri, 20 November 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Joe Means (means@fsl.orst.edu) writes:

> I need prog to give size of a structure in bytes, and I don't find one in the
> IDL 5.1 distribution. Has anyone else written one?

I haven't written one, but here is how I might do it.
The "help" information contains the size of the structure
in bytes. I might capture this help information and parse the
information out of it. I'm not sure, however, if this is
the *actually* size of the structure (taking into account
byte boundaries, etc.) or just the number of bytes in the
fields of the structure. Anyway, to get the info, I would
do this:

Help, struct, /Structure, Output=structInfo
stuffIWant = structInfo[0]
lengthInBytes = ParseIt(stuffIWant)

I'll leave the ParseIt routine as an exercise for the reader. ;-)

Cheers,

David

P.S. RSI warns you that following the instructions above
may lead to heartache. I echo their comments.

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: 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: IDL 5.2 available for FTP
Next Topic: Re: INSIGHT 3D Visualization ?

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

Current Time: Sat Oct 11 08:50:15 PDT 2025

Total time taken to generate the page: 1.11799 seconds