[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programming Question



In article <1d8_9711291213@ima.infomail.com>,
Robert.Fletcher@311.ima.infomail.com (Robert Fletcher) wrote:

   >  Enough about me, now my question. How can I, in Applesoft Basic, get input
   > from the keyboard with out stopping the program?

Do you want to just know if a key has been pressed? Or do you want to be
able to get a whole line of input? If the latter, I don't think it can be
done. However, to just "read" the keyboard to know when a key has been
pressed without halting program execution:

10 K = PEEK(49152): POKE 49168, 0: REM Must clear strobe after a read
20 IF K > 127 THEN GOTO 100: REM Value > 127 means key was pressed
30 REM Program continues here
90 GOTO 10: REM Loop back if no key pressed
100 PRINT "Key " CHR$(K - 128) " was pressed"

George Clark