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.

Routine, Debugging, and Other CommandsZTRAPForces an error with a specified error code.ZTRAP:pc ztrapargZTRAP:pc $ZERRORZTRAP:pc $ZEArgumentspcztraparg$ZERROROptional — A postconditional expression.Optional — An error code string. An error code string is specified as astring literal or an expression that evaluates to a string; only the firstfour characters of the string are used.The special variable $ZERROR, which can be abbreviated $ZE.DescriptionThe ZTRAP command accepts both a command postconditional and argument indirection.ZTRAP has three forms:• Without an argument• With a string argument• With $ZERRORZTRAP without an argument forces an error with the error code .ZTRAP ztraparg forces an error with the error code , where xxxx is the first fourcharacters of the string specified by ztraparg. If you specify an expression, rather than aquoted string literal, the compiler evaluates the expression and uses the first four charactersof the resulting string. When evaluating an expression, <strong>Caché</strong> strips the plus sign and leadingand trailing zeros from numbers. All remaining characters of ztraparg are ignored.ZTRAP $ZERROR does not force a new error. It stops execution at the current programstack level and pops stack levels until another error handler is found. Execution then continuesin that error handler with the current error code.408 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!