SELECT
SELECT CASE expr
Perform multiple tests on the expression expr. Offers a
more concise syntax to writing successive IF tests. Once a case
statement is fulfilled the select-case structure will be exited and all
following case statements will not be tested anymore.
See also IF … THEN … ELIF … ELSE … FI structure.
Example 1: Basic select-case expression
x = 12 ' Change value to see what happens
select case x
    case 12
        print "x is 12"
    case 13,14,15
        print "x is 13,14,or 15"
    case else
        print "x is not 12,13,14,15"        
end selectExample 2: Exit of a select structure once a test was successful
x = 2
select case x
    case 2
        print "x is 2"
    case 2
        print "This will never be printed"
end selectExample 3: Use IFF to check a range
x = 4 ' Change value to see what happens
select case x
    case iff(x <= 4, x, x + 1)
        print "x <= 4"
    case iff(x > 4 AND x < 12, x, x + 1)
        print "4 < x < 12"     
end selectExample 4: Using functions
func even(x) 
    local r
    if(x mod 2 == 0 AND x != 0)
        r = x
    else
        r = x + 1
    endif
    return r
end
func uneven(x) 
    local r
    if(x mod 2 != 0)
        r = x
    else
        r = x + 1
    endif
    return r
end
x = 2 ' Change value to see what happens
select case x
    case even(x)
        print "x is even"
    case uneven(x)
        print "x is uneven"
    case else
        print "x is 0"
end selectCode samples using SELECT
    
      000 hello.bas  
      001 3 ways to print hello 5 times.bas  
      002 numeric variables.bas  
      003 conditional branching.bas  
      004 loops.bas  
      005 challenge.bas  
      006 arrays+.bas  
      2048.bas  
      agendus.bas  
      betrayal: crows ii.bas  
      biorythms.bas  
      block.bas  
      bowling7.bas  
      calc.bas  
      checkers.bas  
      chess.bas  
      dia de una fecha.bas  
      doodle.bas  
      Euro_calculator.bas  
      filemanager.bas  
      form demo.bas  
      g5 Life.bas  
      g6 Life.bas  
      gputmalc.bas  
      graphics sampler.bas  
      GUI RPSLS v2.bas  
      hangman v2.bas  
      heap.bas  
      illuminati.bas  
    
  Language
    
      AND  
      AS  
      BAND  
      BG  
      BOR  
      BYREF  
      CALL  
      CASE  
      CATCH  
      CONST  
      DECLARE  
      DEF  
      DO  
      ELIF  
      ELSE  
      ELSEIF  
      END  
      END TRY  
      ENDIF  
      EQV  
      EXIT  
      FALSE  
      FI  
      FOR  
      FUNC  
      GOSUB  
      GOTO  
      IF  
      IFF  
      IMP  
      IN  
      LABEL  
      LET  
      LIKE  
      LOCAL  
      LSHIFT  
      MDL  
      MOD  
      NAND  
      NEXT  
      NOR  
      NOT  
      ON  
      OR  
      REM  
      REPEAT  
      RETURN  
      RSHIFT  
      SELECT  
      STEP  
      STOP  
      SUB  
      THEN  
      THROW  
      TO  
      TRUE  
      TRY  
      UNTIL  
      USE  
      USG  
      USING  
      WEND  
      WHILE  
      XNOR  
      XOR