Locate - AMSTRAD CPC464 User Manual

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

Advertisement

GRAPHICS
From this point on, we will not ask you to press the [ENTER] key after each line. We will just assume
that you will do it automatically.
There are a number of character symbols in the computer' s memory. To print any one of these, use
the key word chr$(). Inside the brackets should be the symbol number, which is in the range from 32
to 255.
Press[CTRL][SHIFT] and [ESC] to reset the computer, then type in:
P r i n t c h r $ ( 2 5 0 )
On the screen you will see character number 250, which is a man walking to the right.
To see all the characters and symbols appear on the screen with their associated number, type in the
following program, remembering to press [ENTER] after each line.
1 0 f o r n = 3 2 t o 2 5 5 : p r i n t n ; c h r $ ( n ) ;
2 0 n e x t n
run
For your reference, the range of characters together with their respective reference numbers, appear
in Appendix III at the back of this book.

LOCATE

This command is used to reposition the character cursor to a specified part of the screen. Unless
changed by the locate 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. To position a character in the centre of the top line in
mode 1, we would use 20,l as the x,y co-ordinates.
To see this, type in: (remember to [ENTER] each line)
... ... ... screen clears, cursor moves to top left
mode 1
1 0 L o c a t e 2 0 , l
2 0 p r i n t c h r $ ( 2 5 0 )
run
Just to prove that this is on the top line, type in:
B o r d e r 0
The BORDER will now be black and you will see the man at the middle of the top line of the screen.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents