EasyManua.ls Logo

Commodore PET - Input

Commodore PET
447 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The
input
data items
must
agree in number and type
with
the variables in
the INPUT list. If the variable types are different. a
?REDO
FROM
START message
is
printed and the
PET
waits
for another input.
Any
response
is
acceptable for
string input: for a numeric variable, however, the
input
must
be
in
proper numeric
form. If at least one but still too few data items are input.
PET
BASIC requests ad-
ditional
input
with
double question marks
(77)
until
the variable list
is
satisfied. If
too many data items are input. the message ?EXTRA IGNORED
is
printed
but
the
program continues. Data
is
input
from the first position past the question mark to
the position where the
RETURN
is
given.
Normally
only a single string item
is
re-
quested to
be
typed in from the keyboard by each INPUT statement. However,
multiple
items can
be
input
and items may
be
input
from
an
existing screen dis-
play.
CAUTION:
If a null list
(RETURN
only)
is
input
in response to
an
INPUT
statement. the program aborts and returns control to
PET
BASIC. The program
can
be
continued, however, by
typing
CONT
in
response to the PETs READY
message.
INPUT can
be
given only in program mode.
Examples:
100 INPUT
A$
200
INPUT
AB$
220
INPUT "ENTER X COORDINATE";X
3060
INPUT
"NAME";N$
INPUT#
The
Input
External
statement
(INPUT#) inputs one or more data items
from
an
external peripheral device to the
PET.
Format:
where:
INPUT#file
{var
var,var,. . ,var
1
nput
data item
1
nput
data items
file
is
the logical file
number
that was given
when
the file was opened.
var
is
a numeric or string variable into
which
the
data item
is
to be input.
Data strings may
not
be
longer than
80
characters (79 characters plus a car-
riage return) because the
input
buffer can hold only
80
characters at a time. Item
separators such
as
commas and carriage returns are recognized by the
PET
when
processing the
INPUT#
statement
but
are discarded and are
not
passed
on
to the
program
as
data.
134

Table of Contents

Related product manuals