Browsing Script Procedure and Function Calls with the Call Stack Panel in Altium Designer
This document is no longer available beyond version 22.0. Information can now be found here: Call Stack Panel for version 25
Parent page: Working with Panels
Summary
The Call Stack panel is used to view the chain of procedures and functions that have led to the current point of execution in the script being debugged.
Panel Access
From the Scripting Editor, the panel can be accessed in the following ways:
- Click View » Panels » Call Stack
- Click the Panels button at the bottom-right of the workspace and select the Call Stack option.
Content and Use
As you step-debug your script, the panel will show the name of any function or procedure that you enter.
When a call to another function or procedure is encountered, the panel will show the name of this additional function/procedure as it is entered. As the function/procedure is called from within a function/procedure, the original function/procedure is still displayed in the panel.
A 'call stack' is effectively set up, showing the relationship between descendant function/procedure calls. The original function/procedure appears at the bottom of the stack, with each subsequently called function/procedure above it, right up to the currently entered function/procedure on the top of the stack.
As script execution drops out of a sub-function/procedure and passes back into the calling function/procedure, the former will be removed from the stack and the calling function/procedure will become the top of the stack.
Double-clicking on an entry in the panel will jump to the corresponding line of script in which the call to the selected function or procedure is made. The line will be highlighted in the color associated with scripting errors and will have the scripting error marker displayed in the right-hand margin. This is purely used for highlighting purposes. It will disappear when you click on the document and does not inhibit the debug session in any way.
This can also be a quick way of defining the next point that you wish to run code execution to, using the Run To Cursor command available from the Run menu or Script Debug toolbar [shortcut: CTRL + F9].