PET VIC-20 C64 C16 Plus/4 C128 X16 M65
GET <variable>
The GET
commands reads a single character from the keyboard buffer and assigns it to the given variable.
STRING
, it will be assigned the character itself, as string.Warning
The variable must be pre-defined.
Waiting for a key in the buffer:
DIM a$ AS STRING * 1 DO GET a$ LOOP UNTIL LEN(a$) > 0 PRINT "you pressed: "; a$
Or a simpler equivalent:
DIM a AS BYTE DO GET a LOOP UNTIL a > 0 PRINT "you pressed: "; CHR$(a)