RUN
The previous example showed a single line program. Most programs have many lines. In front of
each line, a number is first typed in. These numbers tell the computer the order in which to run the
program. When [ENTER] is pressed, the line is stored in the memory until the program is run. Type:
10 print “hello” [ENTER]
Notice that when [ENTER] was pressed, hello was not printed on the screen. To do this, the word
run has to be typed in. Type:
run [ENTER]
You will now see hello on the screen. Note that instead of continually typing in print , you can use
the ? symbol, for example:
10 ? ”hello” [ENTER]
LIST
After a program has been stored in the memory, it is possible to check what has been typed in by
listing the program. Type:
List [ENTER]
and on the screen you will see:
10 PRINT "hello”
which is the program stored in the memory.
Notice how the word PRINT is now in capitals. This means that the computer has accepted PRINT
as a known BASIC keyword.
Type in cls [ENTER] to clear the screen, Note that although the screen is cleared when you type in
cls [ENTER], your program is not erased from the computer’s memory.
GOTO
The GOTO keyword tells the computer to go from one line to another in order to either miss out a
number of lines or to form a loop. Type this in:
10 print "hello" [ENTER]
20 goto 10 [ENTER]
Type:
run [ENTER]
and you will see hello printed continuously on the screen, one under another on the left side. To stop
this program running, press [ESC] once. To start it again, press any other key. To stop it running so
that other instructions can be typed in, press [ESC] twice.