Difference between revisions of "SHIP:Sail:Flow Control:if"

From Serious Documentation
Jump to: navigation, search
Line 4: Line 4:
 
*[[SHIP:Sail:Flow_Control:else|else]]
 
*[[SHIP:Sail:Flow_Control:else|else]]
  
== [[Flow_Control:if|if]] ==
+
== [[SHIP:Sail:Flow_Control|if]] ==
 
<onlyinclude>Branch control to follow one branch of execution or another.
 
<onlyinclude>Branch control to follow one branch of execution or another.
  
Line 11: Line 11:
 
! scope="col" style="text-align:left" | Description
 
! scope="col" style="text-align:left" | Description
 
|-
 
|-
|[[Flow_Control:if|if]]||Takes an expression, which resolves to a {{Reserved|true}} or {{Reserved|false}} value.  Code execution branches according to the resolved expression.
+
|[[SHIP:Sail:Flow Control|if]]||Takes an expression, which resolves to a {{Reserved|true}} or {{Reserved|false}} value.  Code execution branches according to the resolved expression.
 
|}</onlyinclude>
 
|}</onlyinclude>
 
== Example ==
 
== Example ==

Revision as of 11:51, 10 October 2016

See Also

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.

Example

if (expression) statement;

or

if (expression) {
   statement 1;
   ...
   statement n;
}