Goto - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

Notice how the word PR I N T is now in capitals. This means that the computer has
accepted PR I N T as a known BASIC keyword.
Type in: c L s [RETURN] to clear the screen. Note that although the screen is cleared
when you type in: cL s [RETURN], your program is not erased from the computer's
memory.
GOTO
The GOT 0 keyword tells the computer to go from one line to another in order to either
miss out a number oflines or to form a loop. Type in:
HI
p
r
i
n
t
"h eLL
0"
[RETURN]
20
goto
10
[RETURN]
Now type:
run [RETURN]
.... and you will see
he
L L
0
printed continuously on the screen, one under another on
the left side. The reason for this, is that line
20
ofthe program is telling the computer.
to go to line 1
0
and carry on processing the program from there.
To pause the running of this program, 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.
Now type in:
-c-L-s-
[RETURN]- - -
.... to clear the screen.
To see the word
h
eLL
0
printed continuously on each line, one next to another filling
the whole of the screen, type in the previous program but with a semi-colon; after
the quotation marks"
Type in:
1 0 pr
i
n
t
"h eLL
0 " ;
[RETURN]
20
go
t
0
10
[RETURN]
run [RETURN]
Note that the semicolon; tells the computer to print the next group of characters
immediately following the previous one, (unless the next group of characters is too
large to fit on the same line).
Chapter 1 Page 24
Foundation Course

Advertisement

Table of Contents
loading

Table of Contents