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 #352 background imageLoading...
Page #352 background image
Programming
proc
try;
a$
print
a$
endproc
Let
t$
=
"message
ll
try;
t$
The only requirement
IS
that the number and types of parameters supplied must match
the
list
at
tormal parameters
in
the definition
of
the procedure.
The
reason
for
the brief Interlude about parameters
IS
that they give a
neat
way
at wnting
Address
Labels
the procedure
to
print an address label.
For
the purposes
of
testing
we
shall
lIrst write
the procedure
to
show the addresses
on
the display and later convert
it
to
send the
output
to
the pnnte'
We
shall assume that the labels are eight lines of pnnt-out
in
length.
If
this
IS
not right
for
your printer and label combination
you
will
have
to
change the
number
at
lines
of
space
in
the
procedure
so
that
It
matches your reqUirement Remember
to
start saving your procedures
In
"Mailllst" again.
First
we
shall write a procedure that displays a single
line,
the contents of which are
passed via a parameter.
proc
doLine;
x$
print
x$
endproc
We
can now use this procedure
to
display eight lines at text tor the address label.
proc
doLabeL
rem
*****
print
LabeLs
*****
if
issues
if
issues
=1
doline;
"REMINDER
-
Subscription
Now
Due"
eLse
doLine;
end
if
doLine;
doLine;
titLe$
+11
"+fname$
(1)+".
"+surname$
doLine;
street$
doL
ine;
town$
doLine;
county$
doLine;
postcode$
doLine;
""
let
issues
=issues
- 1
update
endif
endproc
The procedure includes a reminder
in
the address label
if
the person
is
about
to
receive
his or her last
issue.
Each time a label
is
printed, that person's issue count
is
reduced
by
one.
If
this number has reached zero then the label
is
not printed.
You
can begin
to
see how useful parameters can be - without them this procedure
would be much longe, Look how easy
it
is
to
combine the
title,
Initial
and surname
for
the tirst line of the address.
Perhaps you are wondering why
we
went
to
the trouble of detining doline when
we
could have
Just
used print statements throughout dolabel. The reason
is
that the routine
in
ItS
present form shows the addresses
on
the display screen.
We
can convert
it
to
send
its
output
to
the printer merely by changing one line
in
doline, instead of having
to
change every print statement
in
dolabel.
All
we
need
to
do
is
change doline
to
read:
proc
doLine;
x$
Lprint
x$
endproc
12/84
25

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