EasyManua.ls Logo

Commodore Plus 4 - Page 80

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...
This
gets
more
interesting
when
variables
are
also
used.
User
input
—i
can
be
displayed,
and
earlier
calculations
saved
in
variables
can
also
be
PRINTed
out,
or
even
used
in
additional
calculations.
Examples
TYPE
10R-10
'
2:
N
=
R
5
20
PRINT
"RIS
";R;"
AND
N
IS
";N
30
PRINT
"BUT
R
TIMES
2
IS";R*2
__
40
PRINT
"AND
N
MINUS
2
IS";N-2
Normally,
after
each
PRINT
statement,
the
cursor
automatically
goes
to
the
beginning
of
the
next
line
You
can
override
Ihis
by
putting
a
semicolon
(:)
after
the
PRINT
statement
like
this
200
PRINT
'THESE
TWO
SENTENCE
PARTS
WILL
BE
";
—j
210
PRINT
"PRINTED
ON
THE
SAME
LINE"
■•■,.:,-,,..,:
n.tirit-
INPUT
—*
Format
INPUT
"optional
message
variable
to
be
input
The
INPUT
statement
lets
you
get
data
from
the
program
user
through
the
keyboard,
and
use
it
in
the
program.
The
optional
message
lets
you
tell
the
user
exactly
what
you
are
asking
for;
the
message
is
printed
when
the
INPUT
statement
is
executed,
along
with
a
question
mark
Then
the
Plus
4 waits
for
the
user
to
type
an
answer,
followed
by
press-
ing
the
RETURN
key
The
input
from
the
user
is
placed
in
a
variable
You can
either
get
a
string
from
the
user
by
using
a
string
variable
(AS,
for
example),
or
a
number
by
using
a
numeric
variable
The
INPUT
statement
can
only
be used
in
program
mode
Examples:
TYPE
10
PRINT
"WHAT
IS
YOUR
NAME";
__
20
INPUT
AS
30
PRINT
"I
AM
PLEASED
TO
MEET
YOU";
AS;".11
40
INPUT'HOW
OLD ARE
YOU";AG
50
PRINT
AG;
"
IS
A
BIT
OLDER
THAN
I
AM."
RUN
73'

Other manuals for Commodore Plus 4

Related product manuals