Run this program using RUN and ENTER and the sum will be displayed (25). Run the program again and then type:

PRINT a, b

The variables are still there, even though the program has finished. If you enter a line by mistake, say:

12 b=8

it will go up into the program and you will realise your mistake. To delete this unnecessary line, type:

12 (with ENTER of course)

Line 12 will disappear, and the cursor will appear where line 12 used to be.

Now type:

30 (and ENTER)

This time, the program cursor will appear after the end of the program (having tried to find line 30 and failed). If you enter any line number that does not exist, NextBASIC's Editor will place the cursor where it thinks the line would have been if it existed. This can be a useful way of moving around large programs, but beware – it can be very dangerous because if the line really did exist before you entered the number, it wouldn't exist afterwards (refer to the line 12 example above)!

To list a program on screen, type

LIST

and press ENTER. You may wish to list a program from a certain point onwards. This can be achieved by typing an appropriate line number after the LIST command. Try

LIST 15 (and ENTER)

to see this in action. If, at some point, you find you haven't left enough space between line numbers then you may use the edit menu to renumber a program. To do this, press the EDIT key then select the Renumber option from the menu that appears; this sets the gap between each line number to 10. Try this out and see how the line numbers change.

REM, NEW, INPUT and GO TO

The command NEW erases any old programs and variables in the computer and starts the machine anew. Try it now; type:

NEW

and press ENTER. You'll see the Welcome Screen and then the Startup menu. With the menu on screen, select again the NextBASIC option.

Carefully type in this program, which changes Fahrenheit temperatures to Celsius:

10 REM Temperature Conversion
20 PRINT "deg F","deg C"
30 PRINT
40 @inpF:INPUT "Enter deg F",
   F
50 PRINT F, (F-32)*5/9
60 GO TO @inpF

ZX Spectrum Next User Manual, 3rd Edition (ISBN 978-1-5272-5496-1), written and illustrated by Phoebus R. Dokos. Copyright © 2020-2024 Phoebus Dokos / SpecNext Ltd. Licensed under CC BY-NC-SA 4.0. This is a transcription and can contain errors; check any doubt against the printed page.