Graphics; Locate - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

Graphics
There are a number of character symbols in the computer's memory. To print anyone
of these, we use the keyword:
chr$( )
Inside the brackets should be the symbol number, which is in the range from 32 to
255.
Reset the computer, [CONTROL] [SHIFT] [ESC], then type in:
print chr$(250)
Don't forget to press [RETURN]. On the screen you will see character number 2 5121,
which is a man walking to the right.
To see all the characters and symbols appear on the screen together with their
associated numbers, type in the following program, once again remembering to press
[RETURN] after each line.
10 for n=32 to 255
20 print n;chr$(n);
30 next n
run
For your reference, the range of characters together with their respective numbers
appear in the chapter entitled 'For your reference .... '.
LOCATE
This command is used to reposition the character cursor to a specified part of the
screen. Unless changed by the l
0
cat e command, the character cursor starts at the
top left corner of the screen, which corresponds to x,y co-ordinates 1,1 (x is the
horizontal position and y is the vertical position). In mode 1 there are 40 columns and
25 lines. Therefore, to position a character in the centre ofthe top line in mode 1, we
would use 20,1 as the x,y co-ordinates.
To see this, type in: (remember to [RETURN] each line)
mod e 1 .... screen clears, cursor moves to top left.
10 Locate 20,1
20 print chr$(250)
run
Foundation Course
Chapter 1 Page 55

Advertisement

Table of Contents
loading

Table of Contents