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

Home » Public Forums » archive » regarding scope of variables
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
regarding scope of variables [message #46512] Fri, 25 November 2005 19:33
IDLmastertobe is currently offline  IDLmastertobe
Messages: 54
Registered: June 2004
Member
Hi, I have an array of data and I am trying to keep a copy of it so that i
can restore the origianl data after certain operations. however I found
everytime it reiterates the function, the variable that keeps the copy
would go out of scope and my copy is gone. following is part of my code:

if(size(ydata, /n_dimensions) eq 3) then begin
if(!firsty eq 1) then begin
yarr = ydata
!firsty=0
endif
ydata = smooth(yarr, [1, !smo, !smo])
oyimage->SetProperty, data = ydata
endif

however, the second time when this code is called, the yarr variable
becomes undefined since it goes out of scope. What it copied in the first
time is gone. Since I have no information on the size of the array i'm
copying, i cannot preset an array as system variable to run. Does anyone
have any idea? Thanks.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL to C debug errors
Next Topic: iMap & contouring question

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

Current Time: Wed Oct 08 13:36:40 PDT 2025

Total time taken to generate the page: 0.00741 seconds