EasyManua.ls Logo

Commodore Plus 4 - Input;Output Statements

Commodore Plus 4
234 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...
INPUT/OUTPUT
STATEMENTS
Input/Output
(I/O)
statements
are
used
in
programs
to
communicate
with
the
person
RUNning
the
program.
Before
the
program
is
run.
if
all
the
data
for
the
calculations
is
available,
there
is
really
little
need
for
input
statements.
It
is
often
more
useful
if
the
computer
can
get
data
from
the
person
RUNning
the
program
(we'll call
him
or
her
the
pro
gram
user).
Programs
are
much
more
versatile
if
the
data
is
not
"set
in
stone" before
running
them.
Output
statements
can
be
used
by
the
computer
to
tell
the
person
running
the
program
the
answers
that
the
computer
has
calculated.
Obviously,
output
statements
are
vital;
there
would
be
little
sense
in
RUNning
a
program
that
had
no
output
state*
ments.
{Kind
of
like
a
tree
falling
in
a
forest
with
no
one
around
to
hear;
does
it
make
a
sound?
Does
it
matter?)
Advanced
programmers
also
use
I'O
statements
to
communicate
with
devices
instead
of
with
the
program
user.
You've
probably
done
this
yourself,
but
not
in
a
program—when
you
used
LOAD
or
SAVE
with
your
Datassette
or
Disk
drive.
LOAD
is
basically
an
input
statement
since
the
Plus
4
gets
data
(your
program)
from
your Datassette
or disk
drive
while
SAVE
is
an
output
statement,
as
the
PI
us'4
sends
data
to
those
devices.
In
this
introduction
to
I/O
statements,
we
will
limit
ourselves
to
a
few
of
the
most
important
ones,
the
ones
that
you'll
need
immediately.
They
are.
PRINT. INPUT,
GETKEY,
and
READ,
DATA.
PRINT
is
an
output
statement,
while
the
others
are
input
statements
(Remember
that
all
BASIC
1,0
statements
can be
found
in
the
BASIC
Encyclopedia
at
the
end
of
this
book.)
Statement
name:
PRINT
Format.
PRINT
"text
in
quotes'
or
calculations,
etc.
or
variables
or
numbers
You have used
the
PRINT
statement
often
in
programs
in
earlier
chap
ters.
From
that,
and
from
the
format
example
above,
you
can
see
that
PRINT
is
a
very
versatile
statement.
You
can
use
it
to
PRINT
out
mes
sages,
pictures
made
out
of
graphic
characters,
perform
calculations,
display
the
value
of
a
variable,
and
more. Since
the
PRINT
statement
is
used
so
often,
it
pays
lo
learn
to
use
it
well.
Use#1
Text
Display
Suppose
in
your
program,
you
want
to
inform
the
user
that
his
or
her
checking
account
balance
is
negative,
or
that
purple
lizards
are
_
_
■■

Other manuals for Commodore Plus 4

Related product manuals