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 #23 background imageLoading...
Page #23 background image
•
•
•
Instructing
theCcmputer
To
solve the problem
we
can write a program which
IS
a sequence
of
instrucllons or
statements.
You
can now understand
the
first
two:
LET
dogs
=
9."
LET
days
=
28."
These cause
two
pigeon holes
to
be
set
up,
named, and given numbers or
values.
The
next instruction must perform a multiplication,
for
which the computer's symbol
is
*,
and place
the
result
in
a new pigeon hole called tins thus:
LET
t;
ns
=
dogs
* days,,11
1.
The computer gets
the
values,
9 and
28,
from the two pigeon holes named dogs
and days.
2.
The number 9
is
multiplied
by
28.
3.
A new pigeon hole
IS
set
up and named
tins.
4.
The
result
of
the
multiplication becomes the value
in
the pigeon hole named
tins.
All
this may seem elaborate but
you
need
to
understand the
Ideas,
which
are
very
important.
The only remaining task
is
to
make
the
computer print
the
result which can be done
by typing:
PRINT
tins"l1
which
will
cause
the
output:
252
to be displayed on the screen.
In
summary, the program:
LET
dogs
=9
..
,
LET
days
= 28
..
,
LET
tins
=
dogs
*
days."
PRINT
tins.1I
causes the internal effects best imagined
as
three named pigeon holes containing
numbers:
x
days0
and the output on the screen:
252
Of
course,
you
could achieve this
result
more easily with a calculator or a pencil and
paper
You
could do
it
quickly
with
the OL by typing:
PRINT
9 *
28"11
which would give the answer
on
the
screen.
However,
the ideas
we
have discussed
are
the essential starting points
of
programming
in
SuperBASIC.
They
are
so
essential that
they occur
in
many computer languages and have been given special
names.
1.
Names such
as
dogs, days and tins are called identifiers.
2.
A single instruction such
as:
LET
dogs
=
9."
is
called a statement:
3.
The arrangement of name and associated pigeon hole
is
called a variable. The
execution of the above statement
stores
the value 9
in
the pigeon hole 'identified'
by the identifier
dogs.
12/84 7

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