Now run it. You will see the headings printed on the screen by line 20, but what happened to line 10? Apparently the computer has completely ignored it changing its colour to red. Indeed, REM in line 10 stands for REMark and is there solely to remind you of what the program does. A REM command consists of REM or the semicolon symbol ( ; ) followed by anything you like, and the computer will ignore it right up to the end of the line.
REM is not really part of a NextBASIC program, it just adds remarks to it for improved readability and documentation and gets totally ignored by NextBASIC. For example:
10 REM this is a remark
20 ; This is also a remark
are functionally equivalent, as are:
10 PRINT 10:REM Remark
20 PRINT 20:; Remark
Note that the colon (:) cannot be ommited, like:
10 PRINT 10;Remark
as then Remark forms part of the PRINT statement. A colon must ALWAYS be used to separate statements on the same line.
By now, the computer has got to the INPUT command on line 40 and is waiting for you to type in a value for the variable F – you can tell this because at the bottom of the screen is a flashing cursor. Enter a number; remember to press ENTER afterwards! Now the computer has displayed the result and is waiting for another number. This is because of line 60, GO TO @inpF, which means exactly what it says. Instead of running out of program and stopping, the computer jumps back to line 40 where the label @inpF is located and starts again. So, enter another temperature. After a few more of these you might be wondering if the machine will ever get bored with this, it won't. Next time it asks for another number, enter the word stop. The computer will stay in the line and the cursor will change shape indicating a non acceptable entry. You have there the choice of hitting BREAK in which case you receive a report H STOP in INPUT, 40:2, which tells you why it stopped, and where (in the second statement of line 40, first being the label @inpF).
If you want to continue the program type:
CONTINUE
and the computer will continue with the INPUT line.
There's a synonym of CONTINUE which is really there for convenience and it's CONT. Try it in lieu of CONTINUE above; it will work in the same way.
Replace line 60 by GO TO 21 – it will make no perceptible difference to the running of the program. If the line number in a GO TO command refers to a non-existing line, then the jump is to the next line after the given number.
This, however, is NOT the case when using GO TO to jump to a label as the latter MUST exist otherwise an error will be produced. The same allowance for line numbers is true as well for RUN; in fact RUN on its own actually means RUN 0.
Now type in numbers until the screen starts getting full. When it is full, the computer will move the whole of the top half of the screen up one line to make room, losing the heading off the top. This is called scrolling.
When you are tired of this, stop the program as shown above and get the listing by pressing ENTER.
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.