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

Home » Public Forums » archive » Re: update variable in 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: update variable in structure [message #66946 is a reply to message #66928] Tue, 16 June 2009 16:55 Go to previous messageGo to previous message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
"M. Suklitsch" <martin@suklitsch.at> wrote in message
news:308ff1f9-67da-493e-bde1-46d29e3f63cf@a7g2000yqk.googleg roups.com...
> 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
> ===============
...
> And now the rather simple question: how come this doesn't work?


Passs the structure, then inside modify the field you need modified:

PRO update_value, input

input.test = 13

END

data = {test:2, str:'hello'}

update_value, data

print,data

end


Note: you can get very fancy if you want a general routine,
perhaps pass in the field name and use that string in an execute call,
or pass the field number you want to modify, and access the
structure like input.(0) = 2

cheers,
bob
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: POLAR_CONTOUR plot giving strange values for contour lines
Next Topic: Trial version of Slither, the IDL to Python bridge, available

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

Current Time: Thu Oct 09 22:36:16 PDT 2025

Total time taken to generate the page: 1.44016 seconds