Hello.
For debugging purposes I sometimes need to display stack information to the current device or save it (to a global for example).
There is this snippet offered in documentation:
ClassMethod StackToDisplay()
{
For loop = 0:1:$Stack(-1) {
Write !, "Context level:", loop, ?25, "Context type: ", $Stack(loop)
Write !, ?5, "Current place: ", $Stack(loop, "PLACE")
Write !, ?5, "Current source: ", $Stack(loop, "MCODE")
Write !
}
}
And to save stack to a global there's always an exception method: