{{fbdoc item="title" value="CONTINUE"}}----
Control flow statement to continue next iteration of a loop

{{fbdoc item="syntax"}}##
	**Continue** {[[KeyPgDoloop do]] | [[KeyPgFornext for]] | [[KeyPgWhilewend while]]}
##
{{fbdoc item="desc"}}
	Skips all code until the end clause of a loop structure, i.e. ##[[KeyPgDoloop Do...Loop]]##, ##[[KeyPgFornext For...Next]]##, or a ##[[KeyPgWhilewend While...Wend]]## block, then executes the limit condition check. In the case of a ##[[KeyPgFornext For...Next]]##, the variable is incremented according to the ##[[KeyPgStep Step]]## specified.

	Where there are multiple ##[[KeyPgDoloop Do]]## / ##[[KeyPgFornext For]]## / ##[[KeyPgWhilewend While]]## blocks nested, it will continue on the innermost block of that type, i.e. the last one entered.  You can continue an earlier block of that type by giving the word multiple times, separated by commas.  e.g. ##**continue while, while**##

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/control/continue.bas"}}%%(freebasic)
Dim As Integer n

Print "Here are odd numbers between 0 and 10!"
Print
For n = 0 To 10

  If ( n Mod 2 ) = 0 Then 
	Continue For
  End If
  
  Print n
  
Next n
%%

{{fbdoc item="filename" value="examples/manual/control/continue2.bas"}}%%(freebasic)
 '' simple prime number finder

Print "Here are the prime numbers between 1 and 20!"
Print

Dim n As Integer, d As Integer

For n = 2 To 20
	
	For d = 2 To Int(Sqr(n))
	    
	    If ( n Mod d ) = 0 Then ' d divides n
	        
	        Continue For, For ' n is not prime, so try next n
	        
	    End If
	    
	Next d
	
	Print n
	
Next n
%%

{{fbdoc item="lang"}}
	- Not available in the //[[CompilerOptlang -lang qb]]// dialect unless referenced with the alias ##**""__Continue""**##.

{{fbdoc item="diff"}}
	- New to ""FreeBASIC""

{{fbdoc item="see"}}
	- ##[[KeyPgExit Exit]]##

{{fbdoc item="back" value="CatPgControlFlow|Control Flow"}}