Futurebasic/Language/Reference/select case

Syntax 1
SELECT [CASE] targetExpr CASE testExpr [,testExpr ...] [,max32TestExpr ...] [statementBlock] [CASE testExpr [,testExpr ...] [,max32TestExpr ...] [statementBlock]...] [CASE ELSE [statementBlock]] END SELECT

Syntax 2
SELECT [CASE] CASE booleanExpr [,booleanExpr ...] [,max32T booleanExpr ...] [statementBlock] [CASE booleanExpr [,booleanExpr ...][,max32T booleanExpr ...] [statementBlock]...] [CASE ELSE [statementBlock]] END SELECT

Description
The  statement marks the beginning of a "select block," which must end with an   statement. You can use a select block to conditionally execute a block of statements based on a number of tests that you specify. When there is only one test, it's often more convenient to use a  block. A select block is useful when there are two or more conditions to test.

If you use Syntax 1,  must be a numeric or string expression. Each  has the following syntax:

[=|<>|<|<=|>|>=]expr

where  is an expression of the same type as. When the select block executes,  is compared against each   in order. If the does not include a comparison operator (, , etc.), then   is compared for equality with  ; otherwise   is compared with   using the indicated operator.

If the comparison of  with   is true, the   (if any) following that   statement is executed; then execution continues at the first statement after. If none of the comparisons in any  statement is true, the   (if any) following the   statement is executed; then execution continues at the first statement after. Each can consist of any number of executable statements, possibly including other   blocks.

If you use Syntax 2, each  must be a numeric expression that can be evaluated as "true" (nonzero) or "false" (zero). Typically,  will be an expression that includes operators such as ,  , ,  , etc. When the select block executes, each   is evaluated in order, until one is found that is nonzero ("true"). Then the  (if any) under the corresponding   statement is executed; then execution continues at the first statement after. If every  is zero ("false"), the   (if any) following the   statement is executed; then execution continues at the first statement after.