DIM
DIM <list of: subscripted variable>
10 CLS:PRINT "Enter 5 names....":PRINT
20 DIM B$(5)
30 FOR N=l TO 5
40 PRINT "Name"N"please";
50 INPUT B$(N)
60 NEXT
70 FOR N=l TO 5
80 PRINT "How wise of you ";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
DRAW <x co-ordinate>,<y co-ordinate>[,<masked ink>]
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: DRAWR, PLOT, PLOTR, MOVE, MOVER, TEST, TESTR,
XPOS, YPOS, ORIGIN
DRAWR
DRAWR <x offset>,<y offset>[,<masked ink>]
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: DRAW, PLOT, PLOTR, MOVE, MOVER, TEST,
TESTR,XPOS,YPOS,ORIGIN