The STOP-AFTER phrase specifies a time-out value for a DO, FOR, or REPEAT block. The integer expression specifies the number of seconds each iteration of a block has until a time-out occurs. If a time-out occurs, the AVM raises the STOP condition and default STOP condition handling occurs. Use an ON STOP phrase on the block (or an enclosing block) to alter the default STOP condition handling.
The following example time-limits a procedure call using a RUN statement::
DEFINE VARIABLE cnt as INTEGER INITIAL 0.
cnt = cnt + 1.
DO STOP-AFTER 5:
* There might be circumstances in which the timer does not run, such as when the session is blocked waiting for a network message or a child process.