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> CommandsTest WRITE "Calculate the square of a number",!FOR {READ !,"Number:",num QUIT:num=""WRITE !,$$Square(num),!QUIT}Square(val)QUIT val*valClearing Levels from the Program StackEach invocation of QUIT removes a context frame from the call stack for your process. The$STACK special variable contains the current number of context frames on the call stack.You can use QUIT from the programmer prompt to clear some or all levels from the programstack. The following example clears the top two levels from the stack:QUIT 2The argumentless QUIT clears all the levels from the stack.Using QUIT for Program Readability<strong>Caché</strong> executes an implicit QUIT at the end of each routine, but you can include it explicitlyto improve program readability.See Also• DO command• DO WHILE command• FOR command• NEW command• WHILE command• XECUTE command• ZQUIT command• $QUIT special variable• $STACK special variable114 <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!