Table of Contents

GET

[pet] [vic20] [c64] [c16] [cplus4] [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)