Tandy TRS-80 Owner Manual & Programming Manual page 79

Color computer disk system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

-APPENDIX
C
"WHAT MONTH(MM)"
:
INPUT MN*
790 BAL
=
800 FOR REC
=
1
TO LOF
(
1
)
810 GET
#1,REC
820 BAL
=
BAL
+
CVN(AMT*)
830
IF
A*
= "M"
AND LEFT*< DATE**
2)
<>
MN* THEN 1030
840 CLS
850
IF
PDTO*
=
"
THEN 930
860 PRINT
a 645
"DATE OF CHECK:":
PRINT
a 84,
DATE*
870 PRINT "CHECK NUMBER:
":
PRINT
3
116,CHN0*
880 PRINT "PAID TO:"
."PRINT a
148,
PDTO*
890 PRINT
a 160>
"ACCOUNT NUMBER:":
PRINT
3
180,ACNO*
900 PRINT "AMOUNT OF CHECK:
":
PRINT
3 211,
USING "**###.##" ;-CVN<AMT*>
910 PRINT "BALANCE:"
:
PRINT
a
243,
USING
"**###„##"*;
BAL
920 GOTO 980
930
PRINT:PRINT:PRINT
"DATE OF
DEPOSIT:" SPRINT
3 85,
DATE*
940 PRINT "DEPOSIT SLIP NUMBER:":
PRINT
3
117,CHN0*
950 PRINT "ACCOUNT NUMBER:
":
PRINT
3
149,ACN0*
960 PRINT "AMOUNT OF DEPOSIT:":
PRINT
a 180,
USING "**###.##";
CVN<AMT*>
970 PRINT "BALANCE:"
:
PRINT a
2
1
2
,
US
I
NG
"
**###
.##'';
BAL
980 PRINT
a
256,
"PRESS <ENTER>
FOR NEXT RECORD OR
<R> TO
RETURN
TO
'SELECTIONS'"
990 AN*
=
INKEY*
1000
IF
AN*
=
CHR*(13) THEN 1030
1010
IF
AN*
= "R"
THEN
1040
1020 GOTO
990
1030 NEXT REC
1040 CLOSE
#1
1050
RETURN
1540
'
1550
'
1560
'
This subroutine terminates
the pro gram.
15
70
'
1580 END
SAMPLE
PROGRAM
#2
SORTING
YOUR
CHECKS.
This subroutine
will
be
especially helpful at
tax
time.
It
takes the checks
file
which you
created
in
"Sample
Program #1" and
sorts
all
the checks
by
account.
Want
to
know
exactly
how much
you
spent
on
medical
bills
(or
business expenses,
contributions,
etc.)?
This
pro-
gram
will
let
you
know
right
away.
210 PRINT
a
258,
"3)
SORT YOUR
CHECKS
BY"
220 PRINT
3 293,
"ACCOUNT NUMBER?"
230 PRINT
a
322,
"4)
END JOB?"
240 PRINT
3 394,
"(1,2,
3,
OR
4)"
270 ON VAL(AN*> GOSUB 310,700.
1080,
1560
1060
'
1070
'
1080
'
This subroutine sorts
the
checks from
those with the
1090
'
smallest account numbers
to
the largest
account numbers
1100
'
using
a
"bubble sort".
Each check
is
handled
as one
1110
'
data string
to
make
the
swaps easier.
1120
'
1130 OPEN "D",#l, "CHECKS/DAT", 40
1140
FIELD #1,40 AS INFO*
1150 FOR
1=1
TO LOF(l)
1160 GET
#1,
I
1170 CHK*(I)
=
INFO*
1180 NEXT
I
1190 CNT
=
1200 FOR
I
=
1
TO
LOFU)
-
1
1210
IF
MID*(CHK*(I),33,3>
<=
MID*<CHK*<I+1),33,3> THEN
1260
1220 TEMP*
=
CHK*(I)
1230 CHK*<I)
=
CHK*<I+1)
1240 CHK*(I+1)
=
TEMP*
1250 CNT
=
1
1260 NEXT
I
1270
IF
CNT
=
1
THEN 1190
1280 CLS
1.290
PRINT
3 194,
"WHAT ACCOUNT
NUMBER
(NNN/ ALL)"
1300 INPUT AN*
1310 FOR
I
=
1
TO LOF(l
)
1320
IF
AN*
<>
"ALL"
AND AN*
<>
MID*(CHK*<I>,33,3) THEN
1510
1330 CLS
1340 PRINT
3 66,
"ACCOUNT NUMBER:"
:PRINT
a
85,MID*(CHK*(I),33,3>
1350
IF
MID*(CHK*(I
),
13,20)
=
"
THEN
1410
1360 PRINT
a 98,
"DATE OF CHECK:":
PRINT
a
117,LEFT*<CHK*(I),8)
1370 PRINT
3 130,
"CHECK NUMBER:"
:
PRINT
a
149,MID*<CHK*<I),9,4)
1380 PRINT
a 162,
"PAID TO:":
69

Advertisement

Table of Contents
loading

Table of Contents