Try OpenEdge Now
skip to main content
ABL Essentials
Procedure Blocks and Data Access : Language statements that define blocks : FOR blocks : Using NEXT, STOP, and QUIT to change block behavior
 
Using NEXT, STOP, and QUIT to change block behavior
There's another one-word statement that works much like LEAVE and that is NEXT. As you might expect, this statement skips any remaining statements in the block and proceeds to the next iteration of the block. You can qualify it with a block name the same way you do with LEAVE.
There are two more such statements that have increasingly more drastic consequences: STOP and QUIT.
STOP terminates the current procedure, backs out any active transactions, and returns to the OpenEdge session's startup procedure or to the Editor. You can intercept a STOP action by including the ON STOP phrase on a block header, which defines an action to take other than the default when the STOP condition occurs.
QUIT exits from OpenEdge altogether in a run-time environment and returns to the operating system. If you're running in a development environment, it has a similar effect to STOP and returns to the Editor or to the Desktop. There is also an ON QUIT phrase to intercept the QUIT condition in a block header and define an action to take other than quitting the session.