next up previous contents
Next: WHICH Get Information on Up: Inspection Functions Previous: ISINF Test for infinities   Contents

Subsections

WHERE Get Information on Program Stack

Usage

Returns information on the current stack. The usage is

   where

The result is a kind of stack trace that indicates the state of the current call stack, and where you are relative to the stack.

Example

Suppose we have the following chain of functions.

 chain1.m
function chain1
  a = 32;
  b = a + 5;
  chain2(b)

 chain2.m
function chain2(d)
  d = d + 5;
  chain3

 chain3.m
function chain3
  g = 54;
  f = g + 1;
  keyboard

The execution of the where command shows the stack trace.

--> chain1
[chain3,5] --> where
In where(built in), line 0, position 0
In Eval(where), line 1, position 6
In /localhome/basu/FreeMat2/help/mtex/chain3.m(chain3), line 5, position 11
In /localhome/basu/FreeMat2/help/mtex/chain2.m(chain2), line 4, position 9
In /localhome/basu/FreeMat2/help/mtex/chain1.m(chain1), line 5, position 9
In Eval(chain1), line 1, position 7
[chain3,5] [chain3,5]



Samit K. Basu 2005-03-16