EasyManua.ls Logo

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

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...
Menu
character):
256/9
28.44
increments
on X-axis
Since
there
are
191
increments
on the
7"
Y-axis,
divide
to
find
out how many
increments
are
in
1"
vertical:
191/7
=
27.29
increments
on Y-axis
For convenience,
go ahead and round both
figures off
to
28.
Picking
On
a
Menu Your Own
Size
The
size of this telephone
keyboard menu is
3"
wide
x
4"
long. Why?
Because
in this program
we
decided
each
menu character would
be
1"
x
1".
So, there
are three
characters
in
a
row
(3"
wide)
and there are four
characters
in a column
(4"
long).
Givin'
the Menu the
Third
Degree
Take a closer look at some of the lines
in
the
Menu
program:
In line
20,
X-Pad data (stored
in
the
memory
addresses
in line
250)
is read: 20 GOBUB
250
In line
30,
the Menu only
displays
information on the
Screen when the
Pen
is down:
30 IF S <
>
3
THEN 20
In
line
40,
the row and column are
found by
dividing
X and Y
by
28.
R
is for row and C is for
column:
40 R=INT(Y/28)+l :C+INT<X/28)+l
This line means there are 28 increments
on the
Display
Area
until
you come to
another menu
character. INT in
this
line
tells the Computer to
look only at
the whole
portion
(the
"integer")
of the
number
and ignore
the
decimal
part.
In lines
50,
230,
and
240,
conditions
are set
up
if
the
Pen
is on
the
X-Pad
but
off
the Menu:
50
IF
R>4 OR
C>3 THEN
230
230 PRINT
"*PEN
IS
NOT ON MENU*"
240
GOTO
2S0
Row
1
is at lines
110,
120,
and
130;
Row 2
at
lines
140,
150,
and
160;
and
Row 3 at lines
170,
180,
and
190;
Row
4 at
lines
200, 210,
and
220.
In line
70,
Row
1
causes
the
program
to go to the desired
line
number:
70
ON C GOTO
110
,120
,130
In lines
80, 90,
and
100,
Rows
2, 3,
and
4
are set
respectively:
80 ON C
GOTO
140
,150
,160
90
ON
C GOTO
170
,180
,190
100 ON
C GOTO
200,210,220
In lines
110 through
220,
values are
inserted
for each
Menu character
along
with
a
GOTO
(the specified
line) statement:
110
PRINT
"1"
i:G0T0
260
120 PRINT
11711
i JG0T0
260
130 PRINT
"
3
"
1
l:G0T0
260
140
PRINT
11
4
"
i :G0T0
260
150 PRINT
"5"
!
:G0T0 260
160
PRINT
"
6
"
! :G0T0
260
170
PRINT
..
7
..
.
:G0T0
260
180
PRINT
"8"
i :G0T0
260
190 PRINT
"9"
1
:G0T0 260
200
PRINT
"
*
"
! :G0T0
260
210 PRINT
"
"
! :G0T0
260
220
CL5:G0T0
260
Line
250 accesses
the X-Pad
memory
addresses:
250 X=PEEK(65376>
: Y=PEEK
( 65377
)
55=PEEKC65378)
:RETURN
In line
260,
the Menu
is to
output
only one
Menu
33