EasyManuals Logo

Sinclair QL User Manual

Sinclair QL
422 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #25 background imageLoading...
Page #25 background image
•
LET
pounds
=
7"1'
LET
bars
=
pounds
*
2"11
~I~'""I
LiJ
14
Instructing
the
Computer
•
•
The
program works properly and gives the
output
14
Typing statements without line numbers may produce the desired result but there
are
two
reasons why
this
method,
as
used
so
far,
is
not
satisfactory except
as
a
first
introduction.
1.
The program can only execute
as
fast
as
you
can
type,
This
is
not
very
Impressive
for a machine
that
can do millions
of
operations per second.
2.
The individual instructions
are
not stored after execution
so
you
cannot
run
the
program again or correct
an
error without re-typing the whole thing.
Charles Babbage, a nineteenth century computer pioneer, knew that a successful
computer needed
to
store instructions
as
well
as data
in
internal pigeon
holes.
These
Instructions would
then
be executed rapidly
in
sequence without further human
intervention.
The
program instructions
will
be
stored but
not
executed
if
you
use
line
numbers,
Try
this:
10
LET
price
=
15
..
"
20
LET pens = 7
..
"
30
LET
cost
=
pri
ce
* pens-'II
40
PRINT
cost_II
Nothing happens externally
yet,
but the whole program
IS
stored
Internally.
You
make
it
work by typing:
and the
output
105
should appear,
The
advantage
of
this
arrangement
is
that
you
can
edit or add
to
the program
with
minimal
extra typing,
Later,
you
will
see
the
full
editing features
of
SuperBASIC but
even
at
this early stage
you
can do three things
easily:
replace a line
insert
a new
line
delete a line
A
STORED
PROGRAM
EDITING
A
PROGRAM
Suppose you
wish
to
alter the previous program because the price has changed
to
Replace a
line
20p for a pen. Simply re-type line
10.
10
LET
price
=
20
..
"
This line
will
replace the previous line
10.
Assuming the other lines are
still
stored,
test
the program by typing:
RUN.,
and the new
answer,
140,
should appear.
Suppose you wish
to
insert a line just before the last
one,
to
print the words
Total
Cost:
Insert a new
line
This
situation often arises
so
we
usually choose line numbers
10,
20,
30
...
to
allow space
to
Insert extra
lines.
To
put
In
the extra line type:
35
PRINT
"Total
Cost""11
12/84
9

Other manuals for Sinclair QL

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair QL and is the answer not in the manual?

Sinclair QL Specifications

General IconGeneral
ProcessorMotorola 68008
Clock Speed7.5 MHz
RAM128 KB (expandable to 640 KB)
ROM48 KB
Operating SystemSinclair QDOS
Release Year1984
StorageMicrodrive tape loop
Graphics256x256 pixels, 8 colors
PortsRS-232, ROM cartridge
SoundBeeper (internal speaker)

Related product manuals