EasyManua.ls Logo

AMSTRAD CPC464 - Page 96

AMSTRAD CPC464
249 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Run this and you will see that the print statement of line 20 is repeated until the condition in line 40
is fulfilled. Thus 40 loops back to 20. See the significance of the term variable in the way that the
value of AMSTRAD changes with every looping of the program.
If you want to see whats happening to the value of AMSTRAD during this program, then we can add
in another line at 35.
35 LOCATE 1,20: PRINT AMSTRAD:LOCATE 1,AMSTRAD
run
If that was too fast, slow it down with a delay loop:
36 for n=1 to 500:next
Now add a touch of colour (if you have the CTM640 option) by including:
34 BORDER AMSTRAD
This line switches the colour of the border so that it is set to the value of AMSTRAD by line 30. List
the program again:
1 MODE 1
10 AMSTRAD=0
20 PRINT "AMSTRAD CPC464 colour personal
computer”
30 AMSTRAD = AMSTRAD +1
34 BORDER AMSTRAD
35 LOCATE 1,20:PRINT AMSTRAD:LOCATE 1,AMSTRAD
36 FOR n=l TO 500:NEXT
40 IF AMSTRAD <10 GOTO 20
run
And no doubt you all want to see all the colours available on the CPC464, so alter line 40...
40 IF AMSTRAD <26 GOTO 20
RUN the program, and you will see all the available colours, starting with the darkest, and ending
up with bright white. You can make the border colour number message more useful by adding the
word Border. to line 35:
35 LOCATE 1,20:PRINT "Border ";AMSTRAD:
LOCATE 1,AMSTRAD
run
Whilst were on the subject of borders, when the program has finished and returned to the Ready
prompt enter
BORDER 14,6

Table of Contents

Other manuals for AMSTRAD CPC464

Related product manuals