Instructing
the
Computer
•
FOR SERVICE MANUALS
CONTACT:
MAURITRON
TECHNICAL
SERVICES
www.maurilron.co.Uk
TEl:
01844
-
351694
FAX:
01844
-
352554
and
it
will
be Inserted just before line
40.
The
system
allows
line numbers
in
the range
1
to
32768
to
allow plenty
of
flexibility
In
choosing them.
It
is
difficult to be quite sure
in
advance what changes may be needed.
Now type:
and
the
new
output should
be:
Tota
L
cost
140
Delete line
You
can delete line 35 by typing:
II
IS
as
though
an
empty line has replaced
the
previous
one.
OUTPUT-PRINT
Note how
useful
the
PRINT statement
is
You
can PRINT
text
by using quotes or
apostrophes:
PRINT
"Chocolate
bars".11
You
can
print the values
of
variables (contents
of
pigeon holes) by typing statements •
such
as:
PRINT
bars."
without using quotes.
You
will
see
later
how very versatile the PRINT statement can be
in
SuperBASIG.
It
Will
enable
you
to
place
text
or other output on the screen exactly where you want
it.
But
for
the
present these two
faCilities
are useful enough:
printing of
text
printing values
of
variables (contents
of
pigeon
holes).
INPUT-
INPUT,
READ
A carpet-making machine needs
wool
as
input.
It
then
makes carpets according to the
AND
DATA
current design.
I'.
Carpet
,
Machine
wool
"
design
1
carpets
program
1
----,---,--,--';>
~
?
input data
~
output data
•
If
the
wool
is
changed
you
may get a different carpet.
The same sort
of
relations exist
in
a computer.
However,
if
the
data
is
input into pigeon holes by means
of
LET there are two
disadvantages when
you
get beyond very
trivial
programs:
writing LET statements
is
laborious
changing
such
input
is
also laborious
You
can arrange for data
to
be given
to
a program
as
it
runs.
The INPUT statement
will
cause the program
to
pause and wait for
you
to type
in
something
at
the keyboard.
First
type:
so
that the previous stored program
(if
it
is
still
there)
will
be erased ready for this
new
one.
Now type:
10
LET
price
=
15."
•
20
PRINT
"How
many
pens?"
.11
30
INPUT
pens
."
40
LET
cost
=
prj
ce
*
pens
."
50 PRINT
cost
."
RUN
."
10
12/84