qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
EXIT Statement
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Exits a DO or FOR loop, a FUNCTION or SUB procedure, or a DEF FN function.
 
EXIT {DEF | DO | FOR | FUNCTION | SUB}
 
    ■ 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%
 
See Also    DEF FN    DO...LOOP    FOR...NEXT    FUNCTION    SUB