QBasic 1.1: EXIT Statement

Syntax

EXIT {DEF | DO | FOR | FUNCTION | SUB}

Description / Parameter(s)

DEF Exits a DEF FN function.
DO Exits a DO loop.
FOR Exits a FOR loop.
FUNCTION Exits a FUNCTION procedure.
SUB Exits a SUB procedure.

Example

i% = 0 DO i% = i% + 1 IF i% = 500 THEN EXIT DO LOOP PRINT "EXIT at"; i%