home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
club100
/
bus
/
redblk.ba
< prev
next >
Wrap
Text File
|
2006-10-19
|
2KB
|
78 lines
1 'RB.BA by Richard Hanson v2.1
2 'modified by Robert Benson
3 'Written for Forrest Edwards
4 'Club 100 Library 415-939-1246
5 '
6 'Any filename may be used for input
7 'Select hard copy or screen display
8 'Checks for printer and input error
9 'See RB-DOC.DO for instructions
10 '----------------------------------
20 ' House Keeping
30 '----------------------------------
40 CLEAR2000:MAXFILES=2:ONERRORGOTO600
50 CLS:FILES:PRINT
60 INPUT"Enter account filename";A$
70 OPENA$FORINPUTAS1
80 CLS:PRINT@125,"Do you want a hard copy (y/n)?"
90 Z$=INKEY$
100 IFZ$="Y"ORZ$="y"THENX$="lpt:":GOTO130
110 IFZ$="N"ORZ$="n"THENX$="lcd:":GOTO230
120 GOTO90
130 CLS:P=(INP(187)AND6)
140 IFP=0THENBEEP:PRINT@131,"Printer Turned Off":GOTO500
150 IFP=4THENBEEP:PRINT@132,"Printer Off Line":GOTO500
160 IFP=6THENBEEP:PRINT@130,"Printer Disconnected":GOTO500
170 PRINT@40,"...and the computer said,":GOTO240
200 '---------------------------------
210 ' Process Data File
220 '---------------------------------
230 CLS
240 OPENX$FOROUTPUTAS2
250 IFEOF(1)GOTO510
260 INPUT#1,B
270 PRINT#2,"Starting balance: ";
280 PRINT#2,USING"$####.##";B
290 PRINT#2,""
300 PRINT#2,"NUM DATE TO/FROM FOR AMOUNT DEPOSIT BALANCE"
310 IFEOF(1)GOTO430
320 INPUT#1,N$,D$,P$,W$,A,D
330 B=B-A+D
340 IFX$="lpt:"THENPRINT@123,"You're in the... ";:GOSUB520
350 PRINT#2,N$;SPACE$(6-LEN(N$));
360 PRINT#2,D$;SPACE$(7-LEN(D$));
370 PRINT#2,P$;SPACE$(20-LEN(P$));
380 PRINT#2,W$;SPACE$(20-LEN(W$));
390 PRINT#2,USING"#####.##";A;
400 PRINT#2,USING"#####.##";D;
410 PRINT#2,USING"#####.##";B
420 GOTO310
430 PRINT#2,""
440 PRINT#2,"Ending balance: ";
450 PRINT#2,USING"$####.##";B
460 IFX$="lcd:"GOTO490
470 PRINT#2,CHR$(12)
480 GOTO510
490 PRINTTAB(45)"You're in the... ";:GOSUB520
500 FORX=1TO1600:NEXTX
510 CLOSE:MAXFILES=1:MENU
520 IFB<0THENPRINT"RED "ELSEPRINT"BLACK"
530 RETURN
600 '---------------------------------
610 ' Error Processing
620 '---------------------------------
630 IFERR=52GOTO40
640 IFERR=55GOTO510
700 IFERL=260GOTO810
710 IFERL=280GOTO810
720 IFERL=320GOTO810
730 IFERL=350GOTO810
740 IFERL=360GOTO810
750 IFERL=370GOTO810
760 IFERL=380GOTO810
770 IFERL=390GOTO810
780 IFERL=400GOTO810
790 IFERL=410GOTO810
800 PRINTTAB(40)"...something is wrong!":GOTO500
810 CLS:PRINT@130,"Input error in "A$:GOTO500