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

Home » Public Forums » archive » Re: problem restoring a save file from within a procedure
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
Re: problem restoring a save file from within a procedure [message #44374] Thu, 09 June 2005 09:11
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 09 Jun 2005 16:53:35 +0200, Benjamin Luethi wrote:

> Hi
>
> The variables are properly restored, but only "inside" the procedure.
> Once you leave the procedure, they are discarded.
>
> To access them you have to either return the variables from the procedure
> (PRO plotprecip, var1, var2, var3) or declare them as global variables
> (COMMON).

Or, pass an argument in of the name of a variable being restored:

pro restore_it, my_var
restore,'my_var.sav'
end

then on return my_var will have been set.

JD
Re: problem restoring a save file from within a procedure [message #44380 is a reply to message #44374] Thu, 09 June 2005 08:01 Go to previous message
Hrafnkell is currently offline  Hrafnkell
Messages: 4
Registered: June 2005
Junior Member
Thx alot :)
Re: problem restoring a save file from within a procedure [message #44382 is a reply to message #44380] Thu, 09 June 2005 07:53 Go to previous message
Benjamin Luethi is currently offline  Benjamin Luethi
Messages: 22
Registered: December 2004
Junior Member
Hi

The variables are properly restored, but only "inside" the procedure.
Once you leave the procedure, they are discarded.

To access them you have to either return the variables from the procedure
(PRO plotprecip, var1, var2, var3) or declare them as global variables
(COMMON).

Ben

On Thu, 09 Jun 2005 16:43:46 +0200, Hrafnkell
<hrafnkellpalsson@hotmail.com> wrote:

> Hi
>
> My problem is that I can't restore .sav files from within a procedure.
> There are three restore commands whitin my procedure, each one for a
> different .sav file. Each .sav file contains only one variable (none of
> them with the same name). The three restore commands are the only
> commands in the procedure.
> So my procedure looks like this:
>
> PRO plotprecip
> restore, 'fullpath1'
> restore, 'fullpath2'
> restore, 'fullpath3'
> END
>
> When I run the procedure IDL doesn't issue an error command, but the
> variables aren't restored. The variables are deffinately in the .sav
> files because when I restore them from the command line IDL recognizes
> the variable whitin them. The problem seems to be windows. When I ran
> the procedure on a linux machine everything went fine. Is this a known
> bug?
>
> Any help appreciated, Hrafnkell
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Different scales in the same plot
Next Topic: MacTel

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

Current Time: Wed Oct 08 19:56:16 PDT 2025

Total time taken to generate the page: 0.00690 seconds