GETting On Atari
I'm a new Atari owner and one thing bothers me much about Atari BASIC. In Apple BASIC and in PET/CBM BASIC, one keyword is GET, in terms of strings. Atari's keyword GET has a different meaning. How can I input characters without pressing return? It would be much easier to make advanced games without just using the joysticks.
Howie Fishman
To use Atari's GET command, you must first open a file to the keyboard, e.g. OPEN#1, 4, 0, "K:". You can then GET a keystroke with GET#1, A. A (or whatever variable you use) will contain the ASCII value of the key typed (A = 69 for "E", 97 FOR"a",etc.). GET will always wait for a keystroke.
You can use location 764 to see if a key has been pressed. It normally holds 255, but when a key is pressed, it will contain a "keyboard code" (not ASCII). POKEing 764 with a 255 will reset the register.
100 IF PEEK (764) = 255 THEN 100 110 POKE 764, 255 } Waits for a key 10 OPEN#1, 4, 0, "K" . . . 100 GET #1,A Gets a key