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 #361 background imageLoading...
Page #361 background image
Using
Mulbple
Files
The procedure must be able
to
ask
for
you
to
confirm that the record
is
the
one
you
require.
We
shall
delegate
this
task
to
a separate procedure,
so
we
can
use
it
in
different
situations
If
necessary
proc
confirm
print:
print
"Confirm
(y/n)lI;
Let
yes=Lower(getkey()
)=lI
y
"
cLs
endproc
It
leaves
the
variable yes containing 1
It
you
press
the
Y
key
- otherwise
the
value
is
zero.
Note
the
use
of
the
sign
for
assignment and also
in
a logical condition.
proc
inquire
rem
*****
inqui
re
stock
item
*****
print
input
IlStock
item?
";
name$
use
"sto"
find
name$
Let yes=O
whi
Le
foundO
and
not
yes
dispLay
sprint
confirm
if
not
yes
continue
endif
endwhi
Le
if
not
found()
pri
nt
print
name$;
"
does
not
exi
st"
endif
endproc
This
procedure merely locates
the
correct record. A more usable procedure
for
interrogating the stock
file
IS
query:
proc
query
inquire
cLear
endproc
This uses another procedure, clear, which
walts
until
you
press a
key,
clears
the
screen
and
then
prints a
list
of
the
commands
you
can
use.
We
shall
leave this procedure
until
we
have written the procedures
it
must
list.
Remember
to
leave edit from time
to
time
to
save
these procedures
as
you
enter
them.
Stock
Report
We
can also write a simple procedure
to
produce a general stock report
proc
report
rem
*****
stock
report
*****
c Ls
print
tab
2;
"ITEM";
tab
11;
"CODE";
print
tab
20;
"QUANTITY";
tab
31;
"PRICE";
print
tab
40;
"STOCK
VALUE";
print
Let
totaL=O
use
Il
s
to"
aLL
print
description$(
to
10);tab
11;sto.stockno$;
tab
20;qty;
print
tab
31;1l£";seLLpr;
tab
40;"£";seLLpr*qty
Let
totat=total+seLLpr*qty
endaLL
print
print
"TotaL
stock
vaLue
=£11;
totaL
clear
endproc
34
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