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 #32 background imageLoading...
Page #32 background image
30
IF
A$<=B$
THEN GOTO
70
40
LET
C$=A$
50
LET
A$=B$
60
LET
B$=C$
70
PRINT
A$;" ";("<"
AND
A$<B$)+("="
AND
A$=B$);" ";B$
80
GOTO
10
6. Try this program:
10
PRINT
"X"
20
STOP
30
PRINT
"Y"
When you run it, it will display "X" & stop with report 9/20. Now type
CONT
You might expect this to behave like '
GOTO
20', so that the computer would just stop again without
displaying "Y"; but this would not be very useful, so things are arranged so that for reports with code
(
STOP
statement executed), the line number is increased by 1 for a
CONT
statement. This in our example,
'
CONT
' behaves like '
GOTO
21' (which, since there are no lines between 20 & 30, behaves like '
GOTO
30').
7. Many versions of BASIC (but not the ZX81 BASIC) have an ON statement, which takes the form
ON numeric expression GOTO line number, line number,...,line number In this the numeric expression is
evaluated; suppose its value is n then the effect is that of.
GOTO the nth line number
For instance
ON A GOTO 100, 200, 300, 400, 500
Here, if A has the value 2, then 'GOTO 200' is executed. In ZX81 BASIC this can be replaced by
GOTO
100*A
In case the line numbers don't go up neatly by hundreds like this, work out how you could use
GOTO
a conditional expression
instead.

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