Control Flow Statements

FreeBASIC

Control Flow Statements
 
Statements that direct the flow of program execution.

Transferring Statements
Statements that transfer control to another part of a program.
Branching Statements
Statements that execute one of a number of code branches.
Looping Statements
Statements that execute code repeatedly.

Transferring Statements
Goto
Transfers execution to another point in code defined by a text label.
GoSub
Temporarily transfers execution to another point in code, defined by a text label.
On Goto
Transfers execution to one of a number of points in code defined by text labels, based on the value of an expression.
On Gosub
Temporarily transfers execution to one of a number of points in code defined by text labels, based on the value of an expression.
Return
Returns from a call using GoSub or from a procedure returning a value.

Branching Statements
If..End If
Executes a block of statements if a condition is met.
..Else If..
Executes a block of code if a condition is met and all previous conditions weren't met.
..Else..
Executes a block of code if all previous conditions weren't met.
Select..End Select
Executes one of a number of statement blocks using a set of conditions.
..Case..
Executes a block of code if a condition is met.
..Case Else..
Executes a block of code if all previous conditions weren't met.

Intra-branch control
Exit Select
Prematurely breaks out of a Select..End Select statement.
Looping Statements
While..Wend
Executes a block of statements while a condition is met.
For..Next
Executes a block of statements while an iterator is less than or greater than an expression.
Do..Loop
Executes a block of statements while or until a condition is met.

Intra-loop control
Continue While, Continue For and Continue Do
Prematurely re-enters a loop.
Exit While, Exit For and Exit Do
Prematurely breaks out of a loop.