Commodore 128 System Manual page 275

Table of Contents

Advertisement

The FOR ... NEXT loop in lines 20 and 30 are nested inside the
one in line 10 and 40. Using a STEP increment of .5 is used to
illustrate the fact that floating point indices are valid.
See also the NEXT statement.
GET
Receive input data from the keyboard, one character
at a time without waiting for a key to be pressed.
GET variable list
The GET statement reads each key typed by the user. As the
user types, the characters are stored in the computers memory
(in an area called the keyboard buffer). Up to 10 characters can
be stored here, any characters typed after the 10th are lost. The
GET statement reads the first character from the buffer and
moves the rest up allowing room for more. If there are no
characters in the buffer a null (empty) character is returned. The
word GET is followed by a variable name, either numeric or
string. GET will not pause the program if no characters are in the
buffer (see GETKEY).
If the C128 intends to GET a numeric key and a key other than a
number is pressed the program stops and a TYPE MISMATCH
error message is displayed. The GET statement may also be put
into a loop, checking for an empty result. The GETKEY statement
could also be used in this case. See GETKEY for more
information. The GET and GETKEY statements can be executed
only within a program.
EXAMPLE:
10 DO:GETA$:LOOP UNTIL A$="A"
This line waits for the A key to be pressed to continue.
20 GET B, C, D
GET numeric variables B, C and D from the keyboard without
waiting for a key to be pressed.
17-33

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents