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 #49 background imageLoading...
Page #49 background image
•
•
If
you were
to
try
to
write computer programs
to
solve complex problems
you
might
find
it
difficult
to
keep track
of
things. A methodical problem solver therefore divides a
large or complex job into smaller sections or tasks, and then divides these
tasks
again
into smaller
tasks,
and
so
on
until
each can
be
be easily tackled.
This
is
similar
to
the arrangement
of
complex human
affarrs.
Successful government
depends on a delegation
of
responsibility. The Pllme Minister divides the work amongst
ministers, who divide
it
further through the Civil Service until
tasks
can be done by
individuals without further division. There
are
complicating features such
as
common
services and interplay between
the
same
and different
levels,
but the hierarchical structure
is
the dominant
one.
A good programmer
will
also
work
in
this
way
and a modern language
like
SuperBASIC
which allows properly named,
well
defined procedures
will
be much more helpful than
older versions which do
not
have
such
features.
The idea
is
that a separately named block
of
code should be written
for
a particular
task.
It
doesn't matter where the block
of
code
is
In
the program.
If
It
is
there somewhere,
the use
of
Its
name
will
:
activate the code
return control
to
the
pOint
in
the program Immediately after that
use.
If
a procedure, square, draws a square the scheme
is
as
shown below:
CHAPTER
7
SIMPLE
PROCEDURES
procedure definition
DEFine PROCedure square
REMark Code
to
draw square
END DEFine
procedure call
0(-----
square
•
1
draws a square
In
practice the separate
tasks
within a
Job
can be identified and named before the
definition code
IS
wlltten. The' name
is
all
that
is
needed
In
calling the procedure so
the main outline
of
the program can be written before
all
the
tasks
are
defined.
Alternatively
if it
is
preferred, the tasks can be written
first
and
tested.
If
It
works you
can then forget the details and just remember the name and what the procedure does.
The
following example could
qUite
easily
be
written without procedures but
it
shows
how Example
they can be used
in
a reasonably simple context. Almost any task can
be
broken down
in
a similar fashion which means that you never have
to
worry about more than,
say,
five
to
thirty lines
at
anyone
time.
If
you can wllte thirty-line programs
well
and handle
procedures, then
you
have the capability
to
write three-hundred-line programs.
You
can produce ready made buzz phrases
for
politicians or others who
wish
to
give
an
impression
of
technological fluency without actually knowing anything.
Store
the
following words
in
three arrays and then produce ten random buzz phrases.
adjec1$
Full
Systematic
Intelligent
Controlled
Automated
Synchronised
Functional
Optional
Positive
Balanced
Integrated
Coordinated
Sophisticated
12/84
adjec2$
fifth-generation
knowledge-based
compatible
cybernetic
user-friendly
parallel
learning
adaptable
modular
structured
logic-oriented
file-oriented
standardised
nounS
systems
machines
computers
feedback
transputers
micro-chips
capability
programming
packages
databases
spreadsheets
word-processors
objectives
33

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