' SELECT CASE — Multiple selection with TO, IS, CASE ELSE
#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    LOCAL n AS LONG

    INPUT "Enter a number (1-12): ", n
    PRINT

    SELECT CASE n
        CASE 1 TO 3
            PRINT "Q1 (Winter)"
        CASE 4 TO 6
            PRINT "Q2 (Spring)"
        CASE 7 TO 9
            PRINT "Q3 (Summer)"
        CASE 10 TO 12
            PRINT "Q4 (Fall)"
        CASE IS < 1
            PRINT "Too low!"
        CASE IS > 12
            PRINT "Too high!"
        CASE ELSE
            PRINT "Unknown"
    END SELECT

    SELECT CASE n
        CASE 2
            PRINT "February has 28/29 days"
        CASE 4, 6, 9, 11
            PRINT "This month has 30 days"
        CASE 1, 3, 5, 7, 8, 10, 12
            PRINT "This month has 31 days"
    END SELECT

    FUNCTION = 0
END FUNCTION
