11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

$STACKDOXECUTE$$ECODEReturned when the specified context was established by a DO command.Returned when the specified context was established by an XECUTEcommand.Returned when the specified context was established by a user-definedfunction reference.The error code of the error that caused the specified context to be addedto the error stack. When an error occurs at a context level where an errorhas already occurred, the context information is placed at the next highererror stack level; it is only returned when context information at the specifiederror stack context level is relocated information.When the specified context level is zero (0) or is undefined, $STACK returns the null string.You can also specify a -1 for the context level in the one-argument form of the $STACKfunction. In this case, $STACK returns the maximum context level for the information thatis available that, during normal processing, is the context level number of the currently executingcontext. However, during error processing, $STACK(-1) returns whichever is greater:• The maximum context level of your process error stack• The context level number of the currently executing contextThe Two-Argument Form of $STACK$STACK(context_level,code_string) returns information about the specified context levelaccording to the code-string designation you specify. The following describes the code stringsand the information returned when you specify each.• PLACE — Returns the entry reference and command number of the last command executedat a specified context level. The value is returned in the following format for DOand user-defined function contexts: "label[+offset][^routine name] +command". ForXECUTE contexts, the following format is used: "@ +command".• MCODE — Returns the source routine line, XECUTE string, or $ETRAP string thatcontains the last command executed at the specified context level. (Routine lines arereturned in the same manner as those returned by the $TEXT function.)Note:During error processing, if memory is low while the error stack is being built orupdated, you may not have enough memory to store the source line. In this case,the return value for the MCODE code string is the null string. However, thereturn value for the PLACE code string indicates the location.<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 301

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

Saved successfully!

Ooh no, something went wrong!