QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

See SELECT CASE.

CASE ELSE is used in a SELECT CASE procedure as an alternative if no other CASE statements are true.

Description

Example(s)


a = 100
SELECT CASE a
CASE IS < 99: PRINT "a is < 99"
CASE 99: PRINT "a is 99"
CASE IS > 100: PRINT "a is > 100"
CASE ELSE
PRINT "a is 100"
END SELECT



a is 100



a = 100
SELECT CASE a
CASE 10: PRINT "a is 10"
CASE 20: PRINT "a is 20"
CASE 30: PRINT "a is 30"
CASE ELSE: PRINT "a is something other than 10, 20 and 30"
END SELECT



a is something other than 10, 20 and 30


See Also