SELECT statement

The XCSB select statement is a conditional construct designed to conditionally execute a sequence of statements. The general format of the select statement is:
select rt_expr of

case const_expr_0
	statement_list

case const_expr_1
	statement_list

case const_expr_N
	statement_list

default
	statement_list

end_select

Where:
rt_expr is calculated at run time. The constant expressions const_expr_0 to const_expr_N are calculated only once at compile time.
Operation:
The rt_expr is computed at run time and the statement list whos case label ( const_expr ) matches the rt_expr is executed. If no matches are found the statement list belonging to the default case is executed if it is present (the default case is optional).

Execution of a statement list is not terminated by the next case label. Execution continues through the case label and into the next statement list. To prevent execution falling through from one statement list to the next statement list, the break statement should be be used at the end of the statement list.

select statement examples

Features and Restrictions