![]() |
![]() |
30 |
![]() |
In the example on the previous page, for instance, the main program has loaded two modules, rm_main and text_part. Of these, rm_main han been called from the main program, and is still active. We can see
this,
since MODULE rn_main is markedas the secondactive call out of ten.
This module han called main_menu, a subprogram which is
to be found in MODULE
rn_main, rm_main han called run_tests, and so the traceback continues, listing all ten active calls.
Variables in context
When you’re viewing a traceback, you can determine the context in which any? commands are executed. To do this, put the cursor onto the name of the routine or module you want so investigate. This makes any? commands yield the value of variables in the context of that routine or module
—
that is, the value they hold ix that routine or module. This context is always displayedin the information line,jusl below the title barofthe Dialogue window.
So by using traceback you can examine she value of a variable in an active routine even if it han the same name an a variable in a nested routine. Furthermore, in arecursive routine you can examine the value of a variable as each level of the recursion process.
If you select a routine in this way, and then switch from the traceback view
to the
standard
editing view, the edit window will show the ‘traceback context’, that is,
is
will show the selected routine with the cursor positioned immediately after she statement which called the nensroutioe in she chain. (Obviously this deco not apply
to
thelastroutine in thechain, since it doesn’t contain an active calL Instead, the cursor is positioned immediately after the last executed otatemenL)
Traceback is only meaningful if a program is temporarily halted. If you resume execution while there isa Iraceback in view, the traceback window will clear; it wilt display she new sesceback stack if the program is stopped again before it terminates.
|
![]() |
![]() |
30 |
![]() |