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.

$HALT$HALTContains a halt trap routine call.$HALTDescription$HALT contains the name of the current halt trap routine. A halt trap routine is called byyour application when a HALT command is encountered. This halt trap routine may performclean up or logging processing before issuing a HALT command, or it may substitute otherprocessing rather than halting program execution.You set $HALT to a halt trap routine using the SET command. The halt trap routine isspecified by a quoted string with the following format:SET $HALT=locationHere location can be specified as tag (a label in the current routine), ^routine (the beginningof a specified external routine), or tag^routine (a specified label in a specified external routine).$HALT supports tag+offset in some contexts (but not in procedures). This optional +offsetis an integer specifying the number of lines to offset from tag. <strong>InterSystems</strong> recommendsthat you avoid the use of a line offset when specifying location.$HALT defines a halt trap routine for the current context. If there is already a halt trap definedfor the current context, the new one replaces it. If you specify a non-existent routine name,a HALT command ignores that $HALT and unwinds the stack to locate a valid $HALT ata previous context level.To remove the halt trap for the current context, set $HALT to a null string. Attempting toremove a halt trap by using the NEW or KILL commands results in a error.Halt Trap ExecutionWhen you issue a HALT command, <strong>Caché</strong> checks the current context for $HALT. If no$HALT is defined for the current context (or it is set to a non-existent routine name or thenull string), <strong>Caché</strong> unwinds the stack to the previous context and looks for $HALT there.This process continues until either a defined $HALT is located or the stack is completelyunwound. <strong>Caché</strong> uses the value of $HALT to transfer execution to the specified halt traproutine. The halt trap routine executes in the context at which $HALT was defined. No errorcode is set or error message issued.<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 429

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

Saved successfully!

Ooh no, something went wrong!