contents.gifindex.gif

Case Keyword

Syntax

CASE [ expression : state_exp; ]
[ expression : state_exp; ]
[ expression : state_exp; ]
:
ENDCASE ;

Use

The CASE statement is used under the State_diagram section to indicate the transitions of a state machine when there are multiple possible conditions that affect the state transitions.

You can nest Case statements with If-Then-Else, Goto, and other Case statements, and you can use equation blocks.

Example

case a == 0 : 1 ;
a == 1 : 2 ;
a == 2 : 3 ;
a == 3 : 0 ;
endcase ;


See Also

State_Diagram

Goto

If-Then-Else

With