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
"00:00:01"
is
not
displayed.
2. 3. 8. 6
CURSOR
.................................
(abbreviated format: CU.)
Format
Function
Example
Note
CURSORx,
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 (
*)
abo~t
on
the screen as the cursor
keys are pressed.
1 0 X= 0 :
Y=0
1 5
PRINT
"
lil
"
2 0
CURSOR
X.
Y:PRINT"*";
3 0
GET
A$:
IF
A$=
""
THEN
30
4 0
CURSOR
X.
Y:PRINT"
11
•
5 0
IF
A$="0
" THEN Y
=Y-1
:
REM
"UP
6 0
IF
A$=
"0 " THEN
Y ' Y+1
:
REM
"
DOWN
7 0
IF
A$="CI
"
THEN X= X
-1
:REM
"
LEFT
8 0
IF
A$=
"
1:2
"
THEN X= X+1
:REM
"
RIGHT
90
IF
X<0
THEN X=0
1
00
IF
Y
<0
THEN
Y=0
11
0
IF
X>38
THEN
X= 3 8
12
0
IF
Y>2 4 THEN
Y=24
15
0 GOTO
2 0
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
0
8
10f-----
y
X
39
CURSOR
8.10
24~------------~
---------------------------------------------------------
--------
------
61