Run; List; Goto - AMSTRAD CPC464 User Manual

Cpc464 colour personal computer 64k
Hide thumbs Also See for CPC464:
Table of Contents

Advertisement

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:
1 0 p r i n t " h e l l o " [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:
1 0 ? " h e l l o "
[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:
L i s t [ E N T E R ]
and on the screen you will see:
1 0 P R I N T " 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:
1 0 p r i n t " h e l l o "
[ENTE R]
2 0 g o t o 1 0 [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
once. To start it again, press any other key. To stop it running so
[ESC]
that other instructions can be typed in, press
twice.
[ESC]

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents