SHIP:Sail:Flow Control

From Serious Documentation
Jump to: navigation, search

SHIP supports "C" like flow control statements. See Also:

Flow Control Statements

if

Branch control to follow one branch of execution or another.

Statement Description
if Takes an expression, which resolves to a true or false value. Code execution branches according to the resolved expression.

break

Causes execution to exit from a loop or switch statement branch.

Statement Description
break Causes immediate termination out of a loop or switch block.

else

Branch control to follow the false branch of execution.

Statement Description
else Code execution for the false expression path of the if statement.

do

A loop control construct that guarantees the loop executes at least one time.

Statement Description
do Starts a loop control which executes once before being evaluated for termination via while statement.

case

Branch control that works in conjunction with the switch statement.

Statement Description
case Causes code execution to branch to the matching switch statement expression.

default

Branch control that works in conjunction with the switch statement.

Statement Description
default Causes code execution to branch to it if no matching case statement is found.

continue

Loop control to go to next iteration of the loop.

Statement Description
continue Causes immediate termination of current loop iteration and starts next iteration.

switch

Branch control to follow one of multiple possible parallel branches.

Statement Description
switch Takes an integer value. Code execution branches according to the case that matches the integer value.

while

Loop control construct that evaluates the condition of the loop before executing it.

Statement Description
while Takes an expression and starts executing in a loop until the control evaluates false.

return

Causes execution to exit a function or program and go back to caller.

Statement Description
return Causes immediate termination of a function and passes control back to the caller.

reboot

Function Returns Introduced Description
reboot v5.1.0 Reboot SIM