Call Stack

A call stack is a list of the active procedures and functions showing the order in which they have been called.
This information is important because it is used to track where every active procedure should return when it finishes executing.
The primary purpose of a call stack is to store the return addresses.
An active procedure or function is one that has been called but has not yet exited
There is usually only one call stack associated with a running program.


Call Stack Dialog

The Call stack dialog box displays a list of all active procedure calls.
This helps you trace the program as it executes nested and recursive procedures and functions.
You can display the Call Stack dialog box at any point when you in debug mode.
This is a modal dialog box and cannot be displayed while you step through your code.
SS


Displaying the Call Stack dialog
There are several ways you can display this dialog box
1) Using the shortcut key (Ctrl + L).
2) Use the menu option (View > Call Stack)
3) Use the Call Stack button on the Debug toolbar
4) Using the expand button on the Locals window dialog box


Nested Procedures and Functions

Let's step through the following lines of code and display the Call Stack dialog box when you reach line ?
The procedures called last are placed at the top of the list
The procedures called first are placed at the bottom of the list


You can double click on any procedure and jump immediately to it.
Or highlight the procedure and press the Show button
SS



Recursive Procedures and Functions

Recursion is the ability for a procedure or function to call itself
Let's step through the following lines of code and display the Call Stack dialog box after several iterations


SS
Call stack displays a list of all active procedure calls, including calls from nested procedures and functions.
Very useful if you have any recursive functions.
SS
The call stack keeps track of the procedure calling chain so you can see the sequence of subroutine calls..
(View > Call Stack)
SS
If you are debugging you can quickly display the window by pressing (Ctrl + L).
You can click on any procedure and jump immediately to it.



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext