AMSTRAD CPC464 User Manual page 141

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

Advertisement

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
2 0 D I M B $ ( 5 )
3 0 F O R N = l T O 5
4 0 P R I N T " N a m e " N " p l e a s e " ;
5 0 I N P U T B $ ( N )
60 NEXT
70 F O R N = l T O 5
8 0 P R I N T " H o w w i s e o f y o u " ; B $ ( N ) ;
t o b u y a C P C 4 6 4 "
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 -o r d i n a t e > , < y c o-o r d i n a t e > [ , < m a s k e d i n k > ]
D R A W 2 0 0 , 2 0 0 , 1 3
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 O S , Y P O S , O R I G I N
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 > ]
D R A W R 2 0 0 , 2 0 0 , 1 3
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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents