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

Home » Public Forums » archive » Defining Integer Field in a Structure
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: Defining Integer Field in a Structure [message #27823 is a reply to message #27736] Tue, 06 November 2001 17:30 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Harvey Rarback (rarback@slac.stanford.edu) writes:

>> If you wish to create a stucture definition without
>> actually creating an instance of a structure, you
>> put the structure definition in a file, like this:
>>
>> PRO newstruct__define.pro
>> struct = {NEWSTRUCT, a:0, b:0.0, c:fltarr(10)}
>> END
>
> This is something that has always confused me. It seems like the variable
> "struct" is created (at least help will tell you that it exists). So, does
> IDL
> "actually create an instance of a structure" with this mechanism or not?

Well, of course, I was speaking metaphorically. :-)

Certainly an instance of this structure gets created
in this routine, but its existence is fleeting. In
fact, it exists only as long as it takes to establish
the structure definition in IDL. Once that done, the
struct variable goes out of scope and the memory that
was allocated for its definition can be reused by
the real structure you are trying to create. Think
of it as smoke and mirrors.

Does that clear up the confusion?

Cheers,

David

P.S. Harvey, it is good to hear from you again. I was
afraid you had found something more productive than
IDL to do. :-)
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@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
Previous Topic: RSI, Mac and Tru64
Next Topic: Returning A Variable Length struct to IDL from C

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

Current Time: Wed Oct 08 17:46:29 PDT 2025

Total time taken to generate the page: 0.00585 seconds