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

Home » Public Forums » archive » Structure Creation with Execute
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: Structure creation [message #80536 is a reply to message #3992] Wed, 20 June 2012 07:06 Go to previous messageGo to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
On 20 juin, 13:01, John Coxon <john.co...@gmail.com> wrote:
> On 20/06/2012 11:21, Carsten Lechte wrote:
>
>
>
>
>
>> On 20/06/12 12:07, John Coxon wrote:
>>> Hi there,
>
>>> Having an odd issue with creating structures.
>
>>> idl > med = {avg1, dawnR1:0.0, duskR1:0.0, dawnR2:0.0, duskR2:0.0}
>>> idl > print,med.dawnR1
>>> 0
>>> idl > help,med.dawnR1
>>> <Expression> INT = 0
>
>> I would guess that you previously defined a structure with name avg1
>> that had dawnR1 as an integer. dawnR1's type is determined by the
>> initialisiation value from the very first use of the structure. A naked
>> "40" or "0" is interpreted by IDL as an integer constant.
>
>> Either change to using unnamed structures, or be extra careful when
>> specifying values, e.g. always do 1.0 when you want float, 1d0 when you
>> want double, 40L for long etc.
>
> I see, that would make sense. Is there any way to clear a structure, for
> instance, between two runs of a program?
>
> --
> John Coxonhttp://www.chickensinenvelopes.net/
>
>

If your structure has only numeric fields:

for i=0,N_Tags(your_struct)-1 do your_struct.(i) = 0

alx.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Always Something to Worry About
Next Topic: Re: Always Something to Worry About

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

Current Time: Fri Oct 10 17:26:48 PDT 2025

Total time taken to generate the page: 0.95982 seconds