EasyManua.ls Logo

Radio Shack TRS-80 Model 100

Radio Shack TRS-80 Model 100
210 pages
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...
Line
188 This FOR I NEXT loop compares the name stored
in
N$
to
the name stored
in
the array N$(I).
If
the names are different, execution jumps
to
line 210. Otherwise,
line
200 will be executed next.
It
was necessary
to
use an index variable other than I
in
this loop, because I
is
being used
as
the index variable in the main program and
must not be altered in the interrupt subroutine.
Line
198 The requested employee's rate and hours are displayed below the name.
Line
204t
This RETURN statement terminates execution of the interrupt subroutine
after a rate and hours
is
displayed. Execution resumes
in
the main program with the
statement following the one which
was
interrupted.
Line
218 The NEXT statements define the end of the FOR loop which checks for
the
name in the DATA statements.
If
no
match
is
found, this RETURN statement
terminates execution of the interrupt subroutine.
Lines 3....-3U. These DATA statements contain the six names with their respective
pay rate and hours worked.
This simple program suggests how interrupts can be used in a more elaborate payroll
program. Typically, a practical payroll program will use a personnel file containing
hundreds or perhaps thousands of characters of infomlation for each employee.
Conceivably, you could use different Function Keys to inquire about different types
of
information, for example address, telephone number, number of deductions. length
of
employment, and so on.
Of
course the use of Function
Key
interrupts is not limited
to
payroll programs. You
may very well find applications in other types of programs including scientific,
mathematical, educational
and
other areas of business.
What you have learned:
You
have leamed how
to
program the Function Keys
so
that a string will be entered
with a single keystroke. You have also seen that the Function Keys
may
be
used
to
control execution of a program through the use
of
interrupt subroutines.
163

Other manuals for Radio Shack TRS-80 Model 100

Related product manuals