begin case Statement

The begin case statement starts a case construct.

Syntax

begin case

case logical.exp

{statement{s}}

 .

case logical.exp

{statement{s}}

 .

 .

end case

Description

Use the case statement to alter the sequence of instruction execution based on the value of one or more expressions. If expression in the first case statement is true, the following statements up to the next case statement are executed. Execution continues with the statement following the end case statement.

If the expression in a case statement is false, execution continues by testing the expression in the next case statement. If it is true, the statements following the case statement up to the next case or end case statement are executed. Execution continues with the statement following the end case statement.

If more than one case statement contains a true expression, only the statements following the first such case statement are executed. If no case statements are true, none of the statements between the begin case and end case statements are executed.

If an expression evaluates to the null value, the case statement is considered false.

See Also

begin case Statement

Branching

case Statement

end case Statement

if Statement

Logical Expressions

match Relational Operator

Statements and Functions