Sharp MZ-700 Series Owner's Manual page 63

Personal computer
Hide thumbs Also See for MZ-700 Series:
Table of Contents

Advertisement

Note
The TI$ variable cannot be specified in an INPUT statement. Further, after the time
changes from 23:59:59 to 00:00:00, the time " 0 0 : 0 0 : 0 1 " is not displayed.
2. 3. 8. 6 CURSOR
(abbreviated format: CU.)
Format
Function
Example
Note
CURSOR x , y
x . . . X coordinate (0 to 39)
y . . . Y coordinate (0 to 24)
This command is used to move the cursor to a specified position on the TV (display)
screen, and can be used together with the PRINT and INPUT statements to display
characters in any desired location.
In the system of screen coordinates used, the columns of the screen are numbered
from left to right, starting with 0 on the left side and ending with 39 on the right
side; lines of the screen are numbered from top to bottom, with 0 indicating the
top line of the screen and 24 indicating the bottom line. Thus, the cursor can be
moved to any desired position in the range from (0, 0), which indicates the top
left corner of the screen, to (39, 24) indicates the bottom right corner.
The following program moves an asterisk (>K) about on the screen as the cursor
keys are pressed.
1 0
1 5
20
3 0
4 0
5 0 .
60
7 0
80
9 0
1 00
1 1 0
1 20
1 5 0
X = 0 : Y = 0
P R I N T " E "
C U R S O R
X , Y : P R I N T " * "
;
G E T
A $ : I F
A $ = " "
T H E N
C U R S O R
X , Y : P R I N T "
" ;
3 0
F
A $ = " D
F
A $ = " D
F
A $ = " B
F
A $ = " B
F
X < 0
I F
Y < 0
I F
X > 3 8
I F
Y > 2 4
G O T O
2 0
T H E N
T H E N
T H E N
T H E N
T H E N
T H E N
T H E N
T H E N
Y = Y — 1
Y = Y + 1
X = X - 1
X = X + 1
X = 0
Y = 0
X = 3 8
Y = 2 4
R E M
R E M
R E M
R E M
U P
D O W N
L E F T
R I G H T
If the value specified for either X or Y is other than an integer, it is converted to
an integer by truncating the decimal portion before the cursor is moved.
Other methods of moving the cursor which are used together with the PRINT
statement include the TAB and SPC functions. (See page 62 for a description of
the SPC function.)
0
10
Y
0
X
CURSOR 8.10

Advertisement

Table of Contents
loading

Table of Contents