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

Home » Public Forums » archive » update variable in structure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
update variable in structure [message #66952] Tue, 16 June 2009 09:07
M. Suklitsch is currently offline  M. Suklitsch
Messages: 12
Registered: August 2008
Junior Member
Hi everybody!


Today I have a question regarding the update of variables within a
structure, which does not work as I would expect.

Say we have a very simple program:

===============
PRO update_value, input

input = input MOD 5

END
===============

[In reality, this subroutine/program does some more sophisticated
things, but this is sufficient to prove my point. ;-) ]

Okay, now we call this routine with a variable holding an integer
value.
IDL> my_value = 8
IDL> update_value, my_value
IDL> help, my_value
MY_VALUE INT = 3

So far, so good. Now we do exactly the same, but this time the
variable is embedded in a structure:
IDL> my_struct = {my_value:8}
IDL> update_value, my_value
IDL> help, my_struct, /STRUC
** Structure <8220044>, 1 tags, length=2, data length=2, refs=1:
MY_VALUE INT 8

And now the rather simple question: how come this doesn't work?
Normally IDL is eager to overwrite variables of any kind. On some
occasions, I've seen it overwriting the "parental" variable of a
duplicated one. And more important: is there a way to get the above
thing working?
Maybe important, maybe not: I'm working with IDL 7.0 and have tried it
on Solaris and Linux.


Best regards,
Martin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: file_search: need work around for filenames with square brackets [ ]
Next Topic: IDL 7.1 now available

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

Current Time: Thu Oct 09 09:41:19 PDT 2025

Total time taken to generate the page: 1.35849 seconds