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 #33 background imageLoading...
Page #33 background image
•
•
Drawing
on
the
Screen
Super
BASIC
provides a consistent and
versatile
method
of
stopping repelltive processes.
Imagine
running round and round Inside the program activating
statements.
How can
you
escape? The answer
IS
to
use
an
EXIT statement. But there must be some reason
for escaping.
You
might extend the choice
of
line colours by typing
as
an
amendment
to
the program (do
not
type NEW)
40
INK
RND
(0
TO
6)
..
"
so that
if
RND produces 6 the ink
is
the same colour
as
the paper and
you
will
not
see
it.
This could
be
the reason
for
terminating the repetition.
We
can re-arrange the
program
as
follows:
NEW
.....
10
PAPER
6 :
CLS
..
"
20
BORDER
1
,2
..
"
30
REPeat
star
"'11
40
LET
cotour
=RND(6)
..
"
50
IF
cotour
=6
THEN
EXIT
star
..
"
60
INK
colour
..
"
70
LINE
50,60
TO
RND(100),
RND(100l
..
"
80
END
REPeat
star
..
"
The
important thing
to
nOle
here
is
that
the program continues
until
colour becomes
6.
Control then escapes
from
the loop
to
the point
Just
after line
80.
Since there
are
no
program lines after
80 the program
stops.
Another important concept has been Introduced.
It
is
the idea
of
a decIsion.
IF
colour
= 6
THEN
EXIT
star
This
is
another very useful structure because
it
is
a choice
of
doing something or
not;
we
call
It
a simple binary decision.
Its
general form
is:
fF
condition THEN statement(s)
You
will
see
later how the
two
concepts
of
repetition (or looping) and decision-making
(or selection) are the main structures
for
program control.
You
can stop the program
by pressing the break
keys:
hold down CTRL and then press the space
bar.
You
can score a maximum
of
13
points
from
the following
test.
Check your score with
the answers
on
page
107.
1.
What
IS
a
pixel?
FOR SERVICE MANUALS
CONTACT:
MAURITRON
TECHNICAL
SERVICES
www.mauritron.co.uk
TEL: 01844 - 351694
FAX: 01844 - 352554
•
2
3.
4.
5
6.
7.
8.
9.
How many pixels
fit
across the screen
In
the
low
resolution mode?
How many pixels
fit
from
bottom
to
top
in
low resolution mode?
What are the two numbers which determine the 'address' or position
of
a graphics
point on the screen?
How many colours
are
available
in
the low resolution mode?
Name the keywords which do the following:
i.
draw a line
ii.
select a colour
for
drawing
iii.
select a background colour
iv.
draw a border
(5
points)
What
are
the statements which open and close the REPeal loop?
When does
an
executing REPeat loop terminate?
Why
do
loops
In
SuperBASIC
have
names?
SELF
TEST
ON
CHAPTER
3
12/84
17

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