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 #112 background imageLoading...
Page #112 background image
Some
Techniques
Type
RUN and enter a name followed
by
the ENTER
key
and a number followed
by
the ENTER
key.
Repeat this seven times.
Notice that the data
is
'buffered:
It
IS
stored internally until the system
IS
ready
to
transfer
a batch
to
the Microdrive. The Microdrive
is
only accessed once,
as
you can
tell
from
looking and listening.
COpy
A
FILE
Once a
file
is
established,
It
should be copied immediately
as
a back-up.
To
do
this type
COpy
mdv1
phone
TO
mdv2_phone
READ
A
FILE
You
need
to
be certain that the file
eXists
in
a correct form
so
you should read
it
back
from a Microdnve and display
It
on the screen.
You
can
do
this easily using:
COpy
mdv2_phone
TO
sc
r
The output
to
the screen will not provide spaces automatically between the name and
the number but
It
will proVide a 'newline at the end
of
each record. The output will be:
RON678462
GEOFF896487
ZOE249386
BEN584621
MEG482349
CATH438975
WENDY982387
You
can get a more controlled presentation
of
the data with the following program.
100
REMark Read
Phone
NUmbers
110
OPEN
IN
#5,mdv1
phone
120
FOR
record
= 1
TO
7
130
INPUT
#5,
rec$
140
PRINT,
rec$
150
END
FOR
record
160
CLOSE
#5
The data
is
printed, as before, but this time each pair of fields
is
held
In
the vanable
rec$ before being printed on the screen.
You
have
the
opportunity
to
manipulate
it
into
any desired form.
Note that more than one string variable may be used
at
the
file
creation stage
With
INPUT
and PRINT but the whole record so created may be retrieved from the Mlcrodnve file
with a single
stnng variable (rec$ in the above example).
AN
INSERTION
SORT
EXAMPLE
Method
The following colours are available
In
the low resolution screen mode
(in
code number
order
0-7).
black blue red magenta green cyan yellow white
Wnte a program
to
sort the colours into alphabetical order using an Insertion sort
We
place the eight colours
in
an
array,
colour$, which
we
divide
Into
two parts:
I
LIID
UNSORTED PART
96
We
take the leftmost item of the unsorted part and compare
it
with each item, from right
to
left,
in
the sorted part until
we
find
its
right place.
As
we
compare we shuffle the sorted
items
to
the right
so
that when
we
find the right place
to
insert
we
can
do
so
immediately,
without further shuffling.
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