How to access current program call stack in DataBasic

Using the new exception handler you can do this using the following code example.

Running the following code you can access the current program's call stack.
  ECATCH Dummy
  ETHROW 999,”Dummy”
  Dummy:
  CRT EXCEPT.STK()

Calling the above code in subroutine SUB1 displays:
  T SUB1 14^C MAIN 12   == Line<12> of MAIN, that called SUB1  == Line<14> of SUB1, if this is the ETHROW line above.

Back to articles