Re: basic IDL questions: please help! [message #32588] |
Tue, 22 October 2002 05:59  |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
B.G. wrote:
> Hi, Thanks for reading my question.
>
> I start a program with: pro program_name
> then I've got lots of stuff inbetween that and the "end" at the end of
> the program. After the program quits and returns me to the command
> prompt of IDL, it seems like it has lost all the variables from it's
> memory and I can't work with the variables anymore. I can fix this
> problem with a "stop" before the "end", but Dave's mpi_plot program
> won't seem to work correctly unless it sees an "end" and not a "stop".
You can "fix" this "problem" by running the code at the main level.
You do this by removing (comment out) the "pro program_name" line.
(keep the "end" at the end of the file).
To learn about "scope", search your idl help for "disappearing variables".
That doesn't acutally tell you much, but a quick google search gives us
this page that may help you.
http://people.cs.vt.edu/~kafura/cs2704/scope.html
> I know this is probably pretty rudimentary, but it's always had me
> confused and I'm hoping someone could help me out here by explaining
> what's going on.
>
>
> Also, if I call a program while inside another program how do I get
> IDL to automatically recompile the inner program (or at least check to
> make sure it doesn't need to be recompiled) when IDL compiles the
> "outer" program?
If the program is already in memory, and you make changes to it, you
will have to explicitly compile the code. If the program is not
in memory (and idl can find it by seaching through the paths), it
will load the program and compile it. IDL does this for speed reasons,
since using code in memory is way faster than reading it from file
every time it is called.
Cheers,
bob
|
|
|