Try interrupting the program and entering several other names.
If
you should enter a
name which is not in the data statements, it will be ignored and printing will continue
uninterrupted.
Line
18 The display
is
cleared and the Function Key interrupts are turned on. A string
of
30 spaces
is
stored in the string variable ER$. This will be used to clear a portion
of the display.
Line
28 Function Key
(£1)
will cause a jump
to
an interrupt subroutine beginning in
line 140. The remaining seven Function Keys remain undefined and will therefore
have no effect if they are pressed.
Line
38 The six names in the data statements are read into the string array N$(I), the
rates arc read into the numeric array R(I), and the hours are read into the numeric
array H(I). No dimension statement was required in this example since the subscript
does not exceed 10.
Line
48 The FOR/NEXT loop which begins in this line controls the printing of the six
checks.
Line
58 A box
is
drawn to look something like the outline
of
a check. The
coordinates (12,0) and (226,47) refer to the upper left and lower right hand corners
respectively.
The,
1,BF specifies a box filled with dark cells.
Line
68 The company name RADIO SHACK is printed in the upper left corner
of
the
check.
Line
78 The date
is
printed in the upper right corner of the check.
Line
88 An empty box is drawn in the center
of
the check to make room for the name
and amount
of
the check.
Line
98 The employee name
is
printed on the check after the message
"PAY
TO:
".
Line 188 The salary
is
computed
as
the pay rate R(I) times the hours worked H(I) and
printed on the check below the name.
Line
118 The word
"DOLLARS"
is printed on the same line
as
the salary amount.
Line
128 A delay loop
is
added to allow time to inspect the check before the next one
is
printed.
Line
138 The NEXT I statement
is
the end of the check printing loop. The program
will END after all six checks have been printed.
Line
148 This is the first line of the interrupt subroutine. Execution will jump here if
(£1)
is pressed while the main program
is
executing. The statement in
the
main
program which was interrupted will finish before the interrupt subroutine begins. This
statement will erase the first 30 spaces
of
the next
to
last line on the display. The
purpose
of
this
is
to
erase any name which may be left here from a previous interrupt.
Line
158 This statement erases the first 30 spaces
of
the last line for the same reason
given above.
Line
168 The prompt
"NAME"
is
printed
on
the next to last line.
Line
178 This statement allows a name to be entered and assigns
it
to
the string
variable N$.
162