Qbasicnews.com

Full Version: input to asci
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Well, you don't need to split the cases. A raw select case would work and will be faster:

Code:
k$=INKEY$
SELECT CASE k$
   CASE "p": ' key p
   CASE CHR$(0)+CHR$(75): ' cursor left.
END SELECT

Simpler code. Also if you are an optimization freak it is better to precalculate stuff:

Code:
CursorLeft$=CHR$(0) + CHR$(75)
...
k$=INKEY$
SELECT CASE k$
   CASE "p": 'key p
   CASE CursorLeft$: 'cursor left
END SELECT
true, but I find it easier to work with just numbers....
Pages: 1 2