11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - 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.

NotesContext Levels in Programmer and Application ModesA routine invoked in application mode starts at a different context level than a routine youinvoke with the DO command in programmer mode. When you enter a DO command at the<strong>Caché</strong> Terminal programmer mode prompt, <strong>Caché</strong> creates a new context for the routine called.The routine you call can compensate by establishing a $ESTACK level 0 context and thenuse $ESTACK for all context-level references.Consider the following routine:$ESTACKSTART; Establish an $ESTACK Level 0 ContextNEW $ESTACK; Display the $STACK context levelWRITE !,"$STACK level in routine START is ",$STACK; Display the $ESTACK context level and exitWRITE !,"$ESTACK level in routine START is ",$ESTACKQUITWhen you run START in application mode, you see the following display:$STACK level in routine START is 0$ESTACK level in routine START is 0When you run START in programmer mode (by issuing DO ^START at the <strong>Caché</strong> Terminalprompt), you see the following display:$STACK level in routine START is 1$ESTACK level in routine START is 0$ESTACK and Error Processing$ESTACK is particularly useful during error processing when error handlers must unwindthe call stack to a specific context level. See Error Handling in Using <strong>Caché</strong> <strong>ObjectScript</strong> formore information about error processing.See Also• $STACK function• $STACK special variable• Error Handling in Using <strong>Caché</strong> <strong>ObjectScript</strong><strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 425

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

Saved successfully!

Ooh no, something went wrong!