[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Varaibles higher on the stack



"R.Bauer" <R.Bauer@fz-juelich.de> writes:

> Carsten Dominik wrote:
> 
> > Hi everyone.
> >
> > I am wondering: can I print the value of variables higher up on the
> > calling stack?  In IDLDE version 5.2 this is possible with the
> >
> > "Move up the call stack" and "Move down the call stack" icons.
> >
> > Can I do something similar from the command line or does this use an
> > internal feature of IDL which is not accessible to the ordinary user?
> >
> > - Carsten
> >
> > --
> 
> Result = RECALL_COMMANDS()
> 

Thanks, but that is not what I mean.  I mean this:

pro test
  x=1
  test1
end

pro test1
  x=2
  stop
end


When I run "TEST", the program execution stops at the STOP statement
in the test1 procedure.  When I then ask for the value of X with

   print,x

I get 2, the value of x in the procedure TEST1.

For debugging purposes it can be useful to ask what x was (1) in the
calling procedure TEST.  The answer should be one (1).

In IDL5.2, in the develloment environment you can ask such a question.
When you press the "up stack" button, the variable list shows the
value of x in TEST.  When you press the "Down stack" button, you get
back to the value in TEST1.

However, PRINT always says x is 2, even when the variable display is
showing values higher on the stack (which I would consider a bug).

I would like to know if there is a magic command to read the values of 
variables higher on the calling stack, or if this is only possible in
idlde because it uses some internal stuff not available at the command 
prompt.

I am asking because I would like to support stack motions also with
the Emacs IDL modes.

- Carsten

-- 
Carsten Dominik <dominik@strw.LeidenUniv.nl>     \ _ /
Sterrewacht, P.O. Box 9513                        |X|                _
NL-2300 RA Leiden (The Netherlands)              /| |\    _  _     _/ \
phone +31 (71) 527-5812; FAX +31 (71) 527-5819 ___|o|____/ ~~ \___/    ~~~~~