25.01.2015 Views

Using Caché ObjectScript - InterSystems Documentation

Using Caché ObjectScript - InterSystems Documentation

Using Caché ObjectScript - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Using</strong> %STACK to Display the Stack<br />

Level Type Line Source<br />

1 SIGN ON<br />

2 DO ~DO ^StackTest<br />

3 NEW ALL/EXCL NEW (E)<br />

4 DO TEST+1^StackTest SET A=1 ~DO TEST1 QUIT ;level=2<br />

5 NEW NEW A<br />

6 DO TEST1+1^StackTest ~DO TEST2 ;level = 3<br />

7 ERROR TRAP SET $ZTRAP="TrapTag^StackTest"<br />

8 XECUTE TEST2+2^StackTest ~XECUTE "SET A=$$TEST3()"<br />

9 $$EXTFUNC ^StackTest ~SET A=$$TEST3()<br />

10 PARAMETER AA<br />

11 DIRECT BREAK TEST3+1^StackTest ~BREAK<br />

12 DO ^StackTest ~DO ^%STACK<br />

Under the current execution stack display, %STACK prompts you for a stack display action. You can get help by entering<br />

a question mark () at the “Stack Display Action” prompt.<br />

14.3.2 Displaying the Process Execution Stack<br />

Depending on what you enter at the “Stack Display Action” prompt, you can display the current process execution stack<br />

in four forms:<br />

• Without variables, by entering *F<br />

• With a specific variable, by entering *V<br />

• With all variables, by entering *P<br />

• With all variables, preceded by a list of process state variables, by entering *A<br />

14.3.2.1 Displaying the Stack without Variables<br />

The process execution stack without variables appears when you first enter the %STACK utility or when you type the stack<br />

action *F.<br />

14.3.2.2 Displaying the Stack with a Specific Variable<br />

Enter *V at the “Stack Display Action” prompt, followed by the name of the variable you want to track through the stack.<br />

In the following example, the variable e is being tracked and the display is sent to the screen by pressing RETURN at the<br />

“Device:” prompt.<br />

Stack Display Action: *V<br />

Variable(s):e<br />

Display on Device: <br />

14.3.2.3 Displaying the Stack with All Defined Variables<br />

Enter *P to see the process execution stack together with the current values of all defined variables.<br />

14.3.2.4 Displaying the Stack with All Variables, including State Variables<br />

You can print all possible reports to screen, file or printer by entering *A at the “Stack Display Action” prompt. This report<br />

prints the following:<br />

• Process state variables<br />

• Process execution stack with all variables<br />

14.3.3 Understanding the Stack Display<br />

Each item on the stack is called a frame. The following table describes the information provided for each frame.<br />

<strong>Using</strong> <strong>Caché</strong> <strong>ObjectScript</strong> 165

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!