Code:
Input "Option (1) or (2) ", kSelect Case k case 1 : print "You said ONE" case 2 : print "You said TWO" case else 'do nothingEnd Select
Code:
Input "Option (1) or (2) ", kSelect Case k case 1 : print "You said ONE" case 2 : print "You said TWO" case else : print "Error: Invalid Option"End Select
Statistics: Posted by moneo — Thu Feb 02, 2006 9:25 pm
Code:
Input "Option (1) or (2) ", kSelect Case k case 1 : print "You said ONE" case 2 : print "You said TWO" case else 'do nothingEnd Select
Statistics: Posted by Zim — Thu Feb 02, 2006 12:35 pm
Statistics: Posted by paulunknown — Wed Feb 01, 2006 11:52 pm
Code:
SELECT CASE Cheese$ CASE IS "A" ... CASE IS "B" ... CASE IS "C" PRINT "TRY AGAIN" CASE IS "D" PRINT "TRY AGAIN" CASE IS "E" PRINT "TRY AGAIN" CASE IS "F" PRINT "TRY AGAIN"... CASE IS "Z" PRINT "TRY AGAIN"
Code:
SELECT CASE Cheese$ CASE IS "A" PRINT "YOU WIN!" CASE IS "B" PRINT "YOU WIN!" CASE ELSE PRINT "YOU FAIL!"
Statistics: Posted by {Nathan} — Mon Jan 30, 2006 9:27 pm
Statistics: Posted by paulunknown — Sun Jan 29, 2006 3:24 pm
Statistics: Posted by moneo — Fri Jan 27, 2006 10:45 pm
Statistics: Posted by Zim — Fri Jan 27, 2006 12:52 pm
You bonehead...that specific code is never gonna work. k$ is ALWAYS going to be w after the loop because the loop won't end until it is so your SELECT CASE will only ever work with CASE "w". Silly Swede...Code:
DOk$ = INKEY$LOOP UNTIL k$ = "w"SELECT CASE k$[...]
Statistics: Posted by Z!re — Fri Jan 27, 2006 7:01 am
Statistics: Posted by paulunknown — Fri Jan 27, 2006 1:02 am
Code:
Key$ = ""WHILE Key$ = ""Key$ = INKEY$WENDSELECT CASE LCASE$(Key$) 'LCASE$ is optionalCASE "w"[. . .]CASE "e"[. . .]END SELECT
Or, to test for other keys, you can use ASCII, as shown.Code:
SELECT CASE ASC(LCASE$(Key$))CASE 27[. . .] 'ESC was pressed.END SELECT
Statistics: Posted by Patz QuickBASIC Creations — Tue Jan 24, 2006 3:12 pm
Statistics: Posted by Zim — Tue Jan 24, 2006 12:28 pm
Code:
DO SELECT CASE INKEY$ CASE "a" 'do whatever EXIT DO CASE "b" 'do whatever EXIT DO END SELECTLOOP
Statistics: Posted by The Awakened — Mon Jan 23, 2006 1:16 pm