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 #27820 is a reply to message #27736] Tue, 06 November 2001 18:09 Go to previous messageGo to previous message
Harvey Rarback is currently offline  Harvey Rarback
Messages: 24
Registered: September 1998
Junior Member
"David Fanning" <david@dfanning.com> wrote in message
news:MPG.16523ca91d6c3e4a989757@news.frii.com...
> 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?

Yes. It's what I thought was happening. What bothered me
was the overhead in creating the temporary structure.

--Harvey
[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:52:39 PDT 2025

Total time taken to generate the page: 0.00422 seconds