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 #40 background imageLoading...
Page #40 background image
CHAPTER
5
KNOWN
GOOD
PRACTICE
PROGRAMS
AS
EXAMPLES
AUTOMATIC
LINE
NUMBERING
You
have already begun
to
work effectively
with
short programs.
You
may have found
the following practices
are
helpful:
1.
Use
of
lower case for Identifiers: names
of
variables (pigeon holes) or repeat
structures,
etc.
2.
Indenting
of
statements
to
show the content
of
a repeat structure.
3.
Well
chosen identifiers reflecting what a variable or repeat structure
is
used
for.
4.
Editing a program
by:
replaCing a line
inserting a
line
deleting a line
You
have
reached the stage where
it
is
helpful
to
be able
to
study programs
to
learn
from them and
to
try
to
understand what they
do.
The
mechanics
of
actually running
them should now be
well
understood and
in
the following chapters
we will
dispense
with the constant repetition
of:
NEW
before each program
.",
at
the end
of
each line
RUN
to
start
each program
You
will
understand that
you
should use
all
these features when
you
Wish
to
enter and
run
a program. But their omission
in
the text
will
enable
you
to
see
the other details
more clearly
as
you
try
to
imagine what the program
will
do when
it
runs.
If
we
dispense with the above details
we
may use and understand programs more easily
Without
the technical
clutter.
For
example,
the following program generates random upper
case letters until a Z appears.
It
does
not
show the words
NEW
or RUN or the ENTER
symbol but you
still
need
to
use
these.
10
REPeat
letters
20
LET
lettereode
= RND(65
TO
90)
30
eap$
=
CHR$(lettereode)
40
PRINT
eap$
50
IF
eap$
=
"Z"
THEN
EXIT
letters
60
END
REPeat
letters
In
thiS
and subsequent chapters programs
will
be
shown without ENTER symbols. Dlfect
commands
will
also
be shown without ENTER symbols. But you must use these
keys
as
usual.
You
must also remember
to
use NEW and RUN
as
necessary.
It
is
tedious
to
enter line numbers manually. Instead
you
can type:
AUTO
before
you
start
programming and the OL
will
reply
with
a line number:
100
Continue typing lines unlll you have finished your program when the screen
will
show:
100
PRINT
"F;
rst"
110
PRINT
IlSecond"
120
PRINT
"End"
To
finish
the automatic production of line numbers
use
the BREAK sequence:
Hold
down
the
CTRL
and
press
the
SPACE
bar.
This
will
produce
the
message:
130
not
complete
and line
130
will
not be Included
in
your program.
12/84

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