EXIT

Top  Previous  Next

Action

Exit a  FOR..NEXT, DO..LOOP , WHILE ..WEND or SUB..END SUB.

 

 

Syntax

EXIT [FOR]  [DO]  [WHILE] [SUB]

 

 

Remarks

With the EXIT ... statement you can exit a structure at any time.

 

See also

FOR , DO , WHILE

 

 

Example

Dim A As Byte , B1 As Byte               'DIM variable

A = 2 : B1 = 1

If A >= B1 Then                         'some silly code

Do                                   'begin a DO..LOOP

   A = A + 1                           'inc a

    If A = 100 Then                   'test for a = 100

      Exit Do                         'exit the DO..LOOP

    End If                             'end the IF..THEN

Loop                                   'end the DO

End If                                   'end the IF..THEN