next up previous contents index
Next: Trigger Elements Up: Language Elements Previous: Arithmetic Statements   Contents   Index

Flow Control

There are 4 flow control constructs: begin...end, while...end while, if...else if...else...end if, and select on...case...end select:
begin section-name  

statement(s) 

end section-name

while logical-expression  

statement(s)  ...  
break               # alternative way to exit loop  ... 

end while

if logical-expression then  

statement(s) 
   
    else if logical-expression then


    statement(s) 

 else  

 statement(s) 

end if

The else expressions are optional; there may be as many else-if clauses as desired.

select on expression 
  case constant1  
  statement(s) 

  case constant2  
  statement(s) ... 

  default  
  statement(s) 

end select

No explicit break statement is required in a case clause: flow does not fall from one case into another, but rather terminates at the next case or end statement.



Mohammad Ahmed 2003-07-23