AMSTRAD CPC464 User Manual page 96

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

Advertisement

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 what' s happening to the value of
during this program, then we can add
AMSTRAD
in another line at 35.
3 5 L O C A T E 1 , 2 0 : P R I N T A M S T R A D : L O C A T E 1 , A M S T R A D
run
If that was too fast, slow it down with a delay loop:
3 6 f o r n = 1 t o 5 0 0 : n e x t
Now add a touch of colour (if you have the CTM640 option) by including:
3 4 B O R D E R A M S T R A D
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
1 0 A M S T R A D = 0
2 0 P R I N T " A M S T R A D C P C 4 6 4 c o l o u r p e r s o n a l
c o m p u t e r "
3 0 A M S T R A D = A M S T R A D + 1
3 4 B O R D E R A M S T R A D
3 5 L O C A T E 1 , 2 0 : P R I N T A M S T R A D : L O C A T E 1 , A M S T R A D
3 6 F O R n = l T O 5 0 0 : N E X T
4 0 I F A M S T R A D < 1 0 G O T O 2 0
run
And no doubt you all want to see all the colours available on the CPC464, so alter line 40...
4 0 I F A M S T R A D < 2 6 G O T O 2 0
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:
3 5 L O C A T E 1 , 2 0 : P R I N T " B o r d e r " ; A M S T R A D :
L O C A T E 1 , A M S T R A D
run
Whilst we' re on the subject of borders, when the program has finished and returned to the Ready
prompt enter
B O R D E R 1 4 , 6

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents