EasyManuals Logo

Sinclair ZX81 User Manual

Sinclair ZX81
92 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 #21 background imageLoading...
Page #21 background image
& the answer 75 will appear in the top left-hand corner of the screen. At the bottom left-hand corner you will
see the report 0/20. 0, as you know, means 'OK, no problems', & 20 is the number of the line where it
finished. Press
NEWLINE
, & the listing will come back.
Note that the statements were executed in the order of their line numbers.
Now suppose you suddenly remember that you also need to record the price of yeast. Type
15
LET
YEAST=40
& in it goes. This would have been much harder if the first two lines had been numbered 1 & 2 instead of
10 & 20 (line numbers must be whole numbers between 1 & 9999), so that is why, when first typing in a
program, it is good practice to leave gaps in the line numbers.
Now you need to change line 20 to
20
PRINT
BUTTER,YEAST
You could type out the replacement in full, but there is a way to use what is there already. You see that
little by line 15? This is the program cursor, & the line it points to is the current line. Press the key
(shifted 6), & it will move down to line 20. ( moves it up again.) Now press the
EDIT
key (shifted 1), & a
copy of line 20 will be displayed at the bottom of the screen. Press the key 7 times so that the cursor
moves to the end of the line, & then type
,YEAST (without
NEWLINE
)
The line at the bottom should now read
20 PRINT BUTTER, YEAST
Press
NEWLINE
& it will replace the old line 20. The screen will now look like this:
RUN
this program & both prices will be displayed.
(Here is a useful trick involving
EDIT
, to use when you want to clear the bottom part of the screen
altogether. Press
EDIT,
& the current line will be brought down from the program, replacing what you
wanted deleting. If you now press
NEWLINE
, the line will be put back in the program, making no difference
to it, & the bottom part of the screen will be cleared leaving just the cursor.)
Now type - in a fit of absent-mindedness -
12
LET
YEAST=40
This will go up into the program & you will realise your mistake. To delete this unnecessary line, type
12 (with
NEWLINE
, of course)
You will notice with surprise that the program cursor has gone. You should imagine it as being hidden in
between lines 10 & 15, so if you press it will move up to line 10, while if you press it will move down to

Other manuals for Sinclair ZX81

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Sinclair ZX81 and is the answer not in the manual?

Sinclair ZX81 Specifications

General IconGeneral
ProcessorZilog Z80A
Processor Speed3.25 MHz
ROM8 KB
InputMembrane keyboard
StorageCassette tape
Power Supply9V DC
Dimensions167 mm x 40 mm x 175 mm
Release Year1981
ManufacturerSinclair Research
Weight350 g
Operating SystemSinclair BASIC
RAM1 KB
PortsTV out, expansion port
DisplayTelevision (RF modulator output)

Related product manuals