Table of Contents

GET

PET VIC-20 C64 C16 Plus/4 C128 X16 M65

Syntax

GET <variable>

The GET commands reads a single character from the keyboard buffer and assigns it to the given variable.

Warning

The variable must be pre-defined.

Example

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)