Specifications
Chapter 14. Statement Reference
320
• You can nest the
SELECT…CASE…END SELECT statements to a maximum of
10 levels.
SELECT a
CASE 1
SELECT b
CASE 3
PRINT "a=1,b=3"
END SELECT
CASE 2
PRINT "a=2"
END SELECT
• When using the SELECT statement block together with block-structured state-
ments (DEF FN...END DEF, FOR...NEXT, FUNCTION...END FUNCTION,
IF...THEN...ELSE...END IF, SELECT...CASE...END SELECT, SUB...END SUB
and WHILE...WEND), you can nest them to a maximum of 30 levels.
Syntax errors:
Run-time errors:
Error code and message Meaning
error 26:
Too deep nesting.
error 55: Incorrect use
of SELECT...
CASE...END
SELECT
CASE
, CASE ELSE, or END SELECT
statement appears outside of the
SELECT statement block.
error 56: Incomplete
control struc-
ture
No END SELECT corresponds to
SELECT.
error 71: Syntax error conditionalexpression and
tests do not agree in type.
Error code Meaning
0Ch CASE and END SELECT without SELECT
10h
Expression too long or complex
(The program nesting by
SELECT statement block is too deep.)