EasyManuals Logo

Sinclair QL Beginner's Guide

Sinclair QL
135 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 #19 background imageLoading...
Page #19 background image
The part of the screen in which you have drawn lines and create other output is called a window.
Later you will see how you can change the size and position of a window or create other windows. For
the present we shall be content to draw a border round the current window. The smallest area of light
or colour you can plot on the screen is called a pixel. In mode 8, called low resolution mode, there are
256 possible pixel positions across the screen and 256 down. In mode 4, called high resolution mode,
there are 512 pixels across the screen and 256 down. Thus the size of a pixel depends on the mode.
You can make a border round the inside edge of a window by typing for example:
BORDER 4,2
This will create a border 4 pixels wide in colour red (code 2). The effective size of the window is
reduced by the border. This means that any subsequent printing or graphics will automatically fit
within the new window size. The only exception to this is a further border which will overwrite the
existing one.
A SIMPLE LOOP
Computers can do things very quickly but it would not be possible to exploit this great power if every
action had to be written as an instruction. A building foreman has a similar problem. If he wants a
workman to lay a hundred paving stones that is roughly what he says. He does not give a hundred
separate instructions.
A traditional way of achieving looping or repetition in BASIC is to use a GO TO (or GOTO, they are
the same) statement as follows.
NEW
10 PAPER 6 : CLS
20 BORDER 1,2
30 INK RND(5)
40 LINE 50,60 TO RND(100),RND(100)
50 GOTO 30
RUN
You may prefer not to type in this program because SuperBASIC allows a better way of doing
repetition. Note certain things about each line.
10
Fixed part not repeatd
20
30
Changeable part repeated
40
50
Controls program
You can re-write the above program by omitting the GOTO statement and, instead, putting REPeat
and END REPeat around the part to be repeated.
NEW
10 PAPER 6 : CLS
20 BORDER 1,2
30 REPEAT star
40 INK RND(5)
50 LINE 50,60 TO RND(100),RND(100)
60 END REPEAT star
RUN
We have given the repeat structure a name, star. The structure consists of the two lines:

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