Sure, let's create a class like this:
Class Sample.DC
{
ClassMethod RunMe() As%Status
{
Setx = 1do..NestedOne()
}
ClassMethod NestedOne() As%Status
{
Set y = 2do..NestedTwo()
}
ClassMethod NestedTwo() As%Status
{
set z = 3set err = z / 0
}
}
If you go to your terminal and do ##class(Sample.DC).RunMe() then you will get this error:
<DIVIDE>NestedTwo+2^Sample.DC.1Your terminal will also show this prompt:
USER 4d1>You can examine the variables in the NestedTwo classmethod to determine what went wrong by printing variables in that stack frame, for example: write z. However, you can't print out the values of y and x because they are in a parent stack frame. Instead, you use quit <number> to go back up to the NestedOne and RunMe frames where you can print out the values of y and x. For example, quit 1 will go to NestedOne where the var y is defined.
- Log in to post comments