base.Application.getStackTrace

Returns the function call stack trace.

Syntax

base.Application.getStackTrace()
  RETURNING result STRING

Usage

Discover which functions have been called when a program raises an error. Use the getStackTrace() method to print the stack trace to a log file. This method returns a string containing a formatted list of the current function stack.

You typically use this function in a WHENEVER ERROR CALL handler.

MAIN
  WHENEVER ERROR CALL my_handler
  ...
END MAIN
...
FUNCTION my_handler()
  DISPLAY base.Application.getStackTrace()
END FUNCTION

Example of stack trace output:

#0 my_handler() at debug.4gl:173
#1 save_customer_data() at customer.4gl:1534
#2 edit_customer() at customer.4gl:542
#3 main at main.4gl:23