Contents - Index


TraceBack

 

EES normally highlights the equation in the Equations Window that caused an error.  However, when an error occurs in an internal Function, Procedure, or Subprogram, it is often helpful to know where the routine was called from.  This is particularly true if the routine was called from another Function, Procedure or Subprogram.  When this situation occurs, EES will display a Traceback button in the error message dialog.  A simple example is provided below. 

 

Subprogram solveeqns(Z:X,Y)

  X^2+Y^2=Z

  X=Y^2+1

End

 

Function getx(Z)

  Call solveeqns(Z:X,Y)

  getx=X

End

 

X=getx(-77)

 

 

This example has an equation in the main program that calls a Function, which then calls a Subprogram.  The problem cannot be solved when Z is set to -77 and the following message appears.

 

 

Clicking the Traceback button will activate the Debug window to display a list of routines called with the most recent call at the top of the list, as shown.

 

 

The Traceback Information shows the routine name, the number of times it has been called and the equation in the routine that was being evaluated when the error occurred.  In the example shown above, the error occurred in the SolveEqns subprogram which was called from the GetX function, which in turn was called from the main program

 

Clicking on a line in this dialog will cause the Equations window to be displayed with the selected equation highlighted.  External routines (that were read from a library file) are shown in gray font.  The equations for external routines are not visible in the Equations window, and so clicking on a line in gray font will not have any effect.  The equation in an external routine will be displayed unless the external routine included a $Private directive.  In this case, the word Private will be displayed in place of the equation.

 

The Debug window showing the Traceback Information may be hidden behind on of the other EES windows.  However, it can be brought to the front using the Debug Window menu command in the Windows menu.  The Debug Window menu item may be appear as Traceback Information in the menu.