DIM
D I M < l i s t o f : s u b s c r i p t e d v a r i a b l e >
1 0 C L S : P R I N T " E n t e r 5 n a m e s . . . . " : P R I N T
20 DIM B$(5)
30 FOR N=l TO 5
4 0 P R I N T " N a m e " N " p l e a s e " ;
50 INPUT B$(N)
60 NEXT
70 FOR N=l TO 5
8 0 P R I N T " H o w w i s e o f y o u " ; B $ ( N ) ;
to buy a CPC464"
90 NEXT
COMMAND: Allocate space for arrays and specify maximum subscript values.
Basic must be advised of the space to be reserved for an array, or it will default to 10. Once set either
implicitly or explicitly, the size of the array may not be changed, or an error will result.
A subscripted variable, is one where the same variable name can take a series of values as set out in
the list of integer numbers that comprise the ‘dimension list’.
The first number in the dimension list may be thought of as levels in a multistorey car park, and the
subsequent numbers, the number of parking bays etc. A full understanding of arrays is a major
element in advanced BASIC programming. The size of an array is limited only by available memory,
and the programmers ability to keep track of the entries in the dimension list.
Associated keywords:
ERASE
DRAW
D R A W < x co -ordinate>,<y co-o r d i n a t e > [ , < m a s k e d i n k > ]
DRAW 200,200,13
COMMAND: Draws a line on the screen from the current graphics cursor position to an absolute
position. The co-ordinate positions remain unchanged between the three different screen modes.
Further examples in Chapter 5.
Associated keywords:
D R A W R , P L O T , P L O T R , M O V E , M O V E R , T E S T , T E S T R ,
XP OS, YPOS, ORIGIN
DRAWR
D R A W R < x o f f s e t > , < y o f f s e t > [ , < m a s k e d i n k > ]
DRAWR 200,200,13
COMMAND: To draw a line on the screen from the current graphics cursor position to a position
relative to it.
Associated keywords:
D R A W , P L O T , P L O T R , M O V E , M O V E R , T E S T ,
TE S T R , X P O S , Y P O S , O R I G I N
Содержание 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 ...