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> CommandsAfter <strong>Caché</strong> executes the argument, it returns control to the point immediately after theXECUTE argument.Each invocation of XECUTE places a new context frame on the call stack for your process.The $STACK special variable contains the current number of context frames on the callstack.ArgumentspcAn optional postconditional expression. If the postconditional expression is appended to thecommand, <strong>Caché</strong> executes the XECUTE command if the postconditional expression is true(evaluates to a non-zero numeric value). <strong>Caché</strong> does not execute the XECUTE command ifthe postconditional expression is false (evaluates to zero). If the postconditional expressionis appended to an argument, <strong>Caché</strong> evaluates the argument only if the postconditionalexpression is true (evaluates to a non-zero numeric value). If the postconditional expressionis false, <strong>Caché</strong> that argument and evaluates the next argument (if one exists) or the nextcommand. For further details, refer to Command Postconditional Expressions in Using <strong>Caché</strong><strong>ObjectScript</strong>.expressionA single expression or a comma separated list of expressions. Each expression must containat least one valid <strong>Caché</strong> <strong>ObjectScript</strong> command. The expression can evaluate to a null string(""). In this case, <strong>Caché</strong> performs no action and continues execution with the next XECUTEargument or the next command.ExamplesIn this example, the XECUTE command references the local variables x and y. x and y eachcontain a string literal consisting of three separate <strong>Caché</strong> <strong>ObjectScript</strong> commands thatXECUTE invokes.SET x="SET id=ans QUIT:ans="""" DO Idcheck"SET y="SET acct=num QUIT:acct="""" DO Actcheck"XECUTE x,yThe following example uses XECUTE with a $SELECT construction.XECUTE "SET A=$SELECT(A>100:B,1:D)"The following example executes the subroutine that is the value of A.SET A="WRITE ! FOR I=1:1:5 { WRITE ?I*5,I+1 }"XECUTE A172 <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!