Exit

Control flow statement to exit a compound statement block

Syntax
	Exit {KeyPgDoloopDo | KeyPgFornextFor | KeyPgWhilewendWhile | KeyPgSelectcaseSelect }
	Exit {KeyPgSubSub | KeyPgFunctionFunction | KeyPgOperatorOperator | KeyPgConstructorConstructor | KeyPgDestructorDestructor | KeyPgPropertyProperty }

	Exit {KeyPgDoloopDo [, KeyPgDoloopDo [ , ...] ] |
			KeyPgFornextFor [, KeyPgFornextFor [ , ...] ] | 
			KeyPgWhilewendWhile [, KeyPgWhilewendWhile, [...] ] | 
			KeyPgSelectcaseSelect [, KeyPgSelectcaseSelect [ , ...] ] }

Description
	Leaves a code block such as a KeyPgSubSub, KeyPgFunctionFunction, KeyPgOperatorOperator, KeyPgConstructorConstructor, 
	KeyPgDestructorDestructor, KeyPgPropertyProperty, KeyPgDoloopDo...Loop, KeyPgFornextFor...Next, KeyPgWhilewendWhile...Wend, or a  
	KeyPgSelectcaseSelect Case block. The execution skips the rest of the block and goes to 
	the line after its end.

	Where there are multiple KeyPgDoloopDo / KeyPgFornextFor / KeyPgWhilewendWhile / KeyPgSelectcaseSelect blocks nested, it 
	will skip to the end of the innermost block of that type.  You can skip 
	to the end of multiple blocks of that type by giving the word multiple 
	times, separated by commas.
	For example: Exit While, While

Example
	'e.g. the print command will not be seen

	Do
	   Exit Do ' Exit the Do...Loop and continues to run the code after Loop
	   Print "I will never be shown"
	Loop

	Dim As Integer i, j
	For i = 1 To 10
	   
	   For j = 1 To 10
	      
	      Exit For, For
	      
	   Next j
	   
	   Print "I will never be shown"
	   
	Next i

Differences from QB
	* EXIT OPERATOR, EXIT CONSTRUCTOR, EXIT DESTRUCTOR, EXIT PROPERTY, EXIT 
	  WHILE and EXIT SELECT are new to FreeBASIC.

See also
	* KeyPgSubSub
	* KeyPgFunctionFunction
	* KeyPgDoloopDo...Loop
	* KeyPgFornextFor...Next
	* KeyPgWhilewendWhile...Wend
	* KeyPgContinueContinue

