EXIT
EXIT [FOR|LOOP|SUB|FUNC]
Exits a multi line function definition, a loop, or a subprogram. By default (if no parameter is specified) exits from last command block (loop, for-loop or routine).
- FOR - Exit from the last FOR-NEXT loop
- LOOP - Exit from the last WHILE-WEND or REPEAT-UNTIL loop
- SUB - Return from the current routine
- FUNC - Return from the current function
Example 1: for
for i = 1 to 100
    print i
    exit for
next
' Output: 1Example 2: while
while(i)
    i++
    print i
    exit loop
wend
' Output: 1Example 3: sub
sub MySub(a)
    exit sub
    print a
end
MySub(10)  ' No output, because print in MySub will not be reachedExample 4: func
func MyFunc(a)
    exit func
    return a + 10
end
print MyFunc(10)  ' Output: 0, because return command in MyFunc will not be reachedCode samples using EXIT
    
      000 hello.bas  
      004 loops.bas  
      006 arrays+.bas  
      2048.bas  
      7gables.bas  
      agendus.bas  
      anball 1.0.bas  
      anomail.bas  
      Another center finder.bas  
      another look at trig functions.bas  
      autumn scene.bas  
      bairstow.bas  
      Ball.bas  
      base64.bas  
      biorythms.bas  
      blackbox.bas  
      Blackbox.bas  
      bomb.bas  
      bowling7.bas  
      btn 21.bas  
      bulls and cows.bas  
      calc.bas  
      checkers.bas  
      chess.bas  
      circ.bas  
      circles Kalide v2.bas  
      circumscribe triangle.bas  
      clock.bas  
      clock.bas  
    
  Language
    
      AND  
      AS  
      BAND  
      BG  
      BOR  
      BYREF  
      CALL  
      CASE  
      CATCH  
      CONST  
      DECLARE  
      DEF  
      DO  
      ELIF  
      ELSE  
      ELSEIF  
      END  
      END TRY  
      ENDIF  
      EQV  
      EXIT  
      FALSE  
      FI  
      FOR  
      FUNC  
      GOSUB  
      GOTO  
      IF  
      IFF  
      IMP  
      IN  
      LABEL  
      LET  
      LIKE  
      LOCAL  
      LSHIFT  
      MDL  
      MOD  
      NAND  
      NEXT  
      NOR  
      NOT  
      ON  
      OR  
      REM  
      REPEAT  
      RETURN  
      RSHIFT  
      SELECT  
      STEP  
      STOP  
      SUB  
      THEN  
      THROW  
      TO  
      TRUE  
      TRY  
      UNTIL  
      USE  
      USG  
      USING  
      WEND  
      WHILE  
      XNOR  
      XOR