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.

<strong>Caché</strong> <strong>ObjectScript</strong> CommandsHALTTerminates execution of the current process.HALT:pcH:pcArgumentpcOptional — A postconditional expression.DescriptionThe HALT command terminates execution of the current process. If a $HALT special variableis defined in the current context (or a prior context), issuing a HALT command invokes thehalt trap routine specified in $HALT, rather than terminating the current process. Typically,a halt trap routine performs some clean-up or reporting operations, then issues a secondHALT command to terminate execution.HALT has the same minimum abbreviation as the HANG command. HANG is distinguishedby its required hangtime argument.ArgumentspcAn optional postconditional expression that can make the command conditional. <strong>Caché</strong> executesthe HALT command if the postconditional expression is true (evaluates to a non-zeronumeric value). <strong>Caché</strong> does not execute the command if the postconditional expression isfalse (evaluates to zero). For further details, refer to Command Postconditional Expressionsin Using <strong>Caché</strong> <strong>ObjectScript</strong>.ExamplesIn the following example, HALT allows the user to end the current application and return tothe operating system. The system performs all necessary cleanup for the user. Note the useof the postconditional on the command.MainREAD !,"Do you really want to stop (Y or N)? ",ans QUIT:ans=""HALT:(ans["Y")!(ans="y")GOTO StartStartWRITE !,"This is the Start routine"QUIT50 <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!