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
AMSTRAD
during this program, then we can add
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:
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
2 0 P R I N T " A M S T R A D C P C 4 6 4 colour personal
computer”
3 0 AMSTRAD = A1
34 BORDER AMSTRAD
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 :
LOCATE 1,AMSTRAD
run
Whilst we’re on the subject of borders, when the program has finished and returned to the Ready
prompt enter
BORDER 14,6
Содержание CPC464
Страница 1: ......
Страница 32: ...or you can type 3e1 1e1 ENTER 300 2 3000x1000 Type 3e3 1e3 ENTER 3000000 3 3000x0 001 Type 3e3 1e 3 ENTER 3 ...
Страница 102: ...PRINT 10 AND 12 Results in 8 PRINT 10 AND 1000 Results in 8 again ...
Страница 118: ...TO DO DRAW THIS PAGE ...
Страница 219: ...actual value may be made to vary during the execution of a program ...
Страница 240: ...Text and WINDOW planner Mode 2 80 Columns ...
Страница 241: ......
Страница 245: ...Sound envelope Music planner sheet ...