EasyManua.ls Logo

Radio Shack TRS-80 X-PAD GT-116 - Page 23

Radio Shack TRS-80 X-PAD GT-116
65 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
X-Pad can display the Pen location on
the Screen.
The following
program will generate the blinking Cursor:
5
sREM
CURSOR
PROGRAM
10 PMDDE
3*1
20
PCLS
30 SCREEN i
*1
40
GOSUB
170
50 GOSUB 70
G0 IF S<>3
THEN
40
70
A=PPOINT
(X»Y)
80 IF
A<>5
THEN
130
90
PSET <X*Y>8)
100 FOR
W=l
TO 50: NEXT
1*1
110 PRESET (X»Y)
120 RETURN
130 PSET(X,Yt5)
140 FOR
W=l
TO 50: NEXT W
150 PSET (X
»Y
,A)
160 RETURN
170 X=PEEK(G537B) : Y=
PEEK
(
G5377 ) : 5= PEEK
(G5378)
:RETURN
RUN
the program.
Move
the Pen
over the
Surface
(but
don't touch it!) and you'll see the Cursor
displayed
on the
Screen. As you can see, the Cursor
is
an
orange
blinking
point
on the cyan background.
If you press the
Pen
down on
the
Pad
when
using the
Cursor
program, Extended Color BASIC will
display
a
RETURN WITHOUT
GOSUB
ERROR.
Simply RUN
the program again.
What
happens
is
this:
Line 40
goes
to 170 and gets the data.
Line
70
locates
the
Pen.
Line 60 waits for the Pen
to
enter the
Active Area.
Line 70
gets
the color of the
point.
Line 80 tests
the point.
If the point is set,
it resets
it.
Line 90 sets the point to orange.
Line 100 is
a
delay.
Line 110
resets
the
point
to
orange.
Line
130 sets
the point to
buff.
Line 150
resets
the
color.
Line 160
returns to
caller.
If
you
write
your
own
Cursor
Program (go
ahead,
it's
easy!), be
sure
and
set the
Cursor to a
different
color
than
the
background
color.
Chapter
4
Checkpoint
1.
(True/False)
X-Pad's cu
rsor
moves
across
the
Screen
when you
press
(ENTER) .
2.
(True/False)
X-Pad is
totally
controlled
by
programming
(software).
3.
(True/False) X-Pad
can
read
the
Pen
(and
cursor
if
included in
the
program)
when the
Pen
is
about
10"
above
the
Writing
Surface.
16