mgnslndh/NCicode — Issue #7: SELECT CASE statement
Author: mgnslndh
Created: 2011-11-22 19:21:07+00:00
State: open

>The select case statement executes on several groups of statements, depending on the
>result of an expression. SELECT CASE statements are a more efficient way of writing
>code that would otherwise have to be done with nested IF THEN statements.
>
SELECT CASE Expression
CASE CaseExpression1,CaseExpression2
Statement(s);
CASE CaseExpression3 TO CaseExpression4
Statement(s);
CASE IS >CaseExpression5,IS
>Where CaseExpressionn is any one of the following forms:
>
- expression
- expression TO expression
>
>Where the TO keyword specifies an inclusive range of values. The smaller value needs
>to be placed before TO.
>
- IS expression.
>
>Use the IS keyword with relational operators (). Relational operators that may be
>used are <, <=, =, <>, >, >= .

>If the Expression matches any CaseExpression, the statements following that CASE
>clause are executed up to the next CASE clause, or (for the last clause) up to the END
>SELECT. If the Expression matches a CaseExpression in more than one CASE clause,
>only the statements following the first match are executed.

>The CASE ELSE clause is used to indicate the statements to be executed if no match is
>found between the Expression and any of the CaseExpressions. When there is no CASE
>ELSE statement and no CaseExpressions match the Expression, execution continues at
>the next Cicode statement following END SELECT.

>You can use multiple expressions or ranges in each CASE clause. For example, the following
>line is valid:
>
CASE 1 To 4, 7 To 9, 11, 13, Is > MaxNumber