Caché MultiValue Basic Reference
[Home] [Back] [Next]
InterSystems: The power behind what matters   

Exits a LOOP...REPEAT or FOR...NEXT statement.
The EXIT statement takes no arguments.
The EXIT statement can only be used within a LOOP...REPEAT or FOR...NEXT control structure to provide an alternate way to exit the loop. EXIT transfers control to the statement immediately following the end of the loop structure (the NEXT or REPEAT keyword).
Any number of EXIT statements may be placed anywhere in the block of code statements. EXIT is commonly used with the evaluation of some condition (such as an IF...THEN statement).
When used within nested loop statements,EXIT only exits the loop in which it occurs; EXIT transfers control to the loop that is nested one level above the exited loop.
The GOTO statement can also be used to exit from a loop control structure. The CONTINUE statement exits from the current iteration of a loop; the EXIT statement exits from the loop.
In jBASE emulation mode, EXIT has both an argumentless and an argumented form.
See Also

Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA