home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / bus / redblk.ba < prev    next >
Text File  |  2006-10-19  |  2KB  |  78 lines

  1. 1 'RB.BA by Richard Hanson v2.1
  2. 2 'modified by Robert Benson
  3. 3 'Written for Forrest Edwards
  4. 4 'Club 100 Library 415-939-1246
  5. 5 '
  6. 6 'Any filename may be used for input
  7. 7 'Select hard copy or screen display
  8. 8 'Checks for printer and input error
  9. 9 'See RB-DOC.DO for instructions
  10. 10 '----------------------------------
  11. 20 ' House Keeping
  12. 30 '----------------------------------
  13. 40 CLEAR2000:MAXFILES=2:ONERRORGOTO600
  14. 50 CLS:FILES:PRINT
  15. 60 INPUT"Enter account filename";A$
  16. 70 OPENA$FORINPUTAS1
  17. 80 CLS:PRINT@125,"Do you want a hard copy (y/n)?"
  18. 90 Z$=INKEY$
  19. 100 IFZ$="Y"ORZ$="y"THENX$="lpt:":GOTO130
  20. 110 IFZ$="N"ORZ$="n"THENX$="lcd:":GOTO230
  21. 120 GOTO90
  22. 130 CLS:P=(INP(187)AND6)
  23. 140 IFP=0THENBEEP:PRINT@131,"Printer Turned Off":GOTO500
  24. 150 IFP=4THENBEEP:PRINT@132,"Printer Off Line":GOTO500
  25. 160 IFP=6THENBEEP:PRINT@130,"Printer Disconnected":GOTO500
  26. 170 PRINT@40,"...and the computer said,":GOTO240
  27. 200 '---------------------------------
  28. 210 ' Process Data File
  29. 220 '---------------------------------
  30. 230 CLS
  31. 240 OPENX$FOROUTPUTAS2
  32. 250 IFEOF(1)GOTO510
  33. 260 INPUT#1,B
  34. 270 PRINT#2,"Starting balance: ";
  35. 280 PRINT#2,USING"$####.##";B
  36. 290 PRINT#2,""
  37. 300 PRINT#2,"NUM   DATE   TO/FROM             FOR                   AMOUNT DEPOSIT BALANCE"
  38. 310 IFEOF(1)GOTO430
  39. 320 INPUT#1,N$,D$,P$,W$,A,D
  40. 330 B=B-A+D
  41. 340 IFX$="lpt:"THENPRINT@123,"You're in the... ";:GOSUB520
  42. 350 PRINT#2,N$;SPACE$(6-LEN(N$));
  43. 360 PRINT#2,D$;SPACE$(7-LEN(D$));
  44. 370 PRINT#2,P$;SPACE$(20-LEN(P$));
  45. 380 PRINT#2,W$;SPACE$(20-LEN(W$));
  46. 390 PRINT#2,USING"#####.##";A;
  47. 400 PRINT#2,USING"#####.##";D;
  48. 410 PRINT#2,USING"#####.##";B
  49. 420 GOTO310
  50. 430 PRINT#2,""
  51. 440 PRINT#2,"Ending balance: ";
  52. 450 PRINT#2,USING"$####.##";B
  53. 460 IFX$="lcd:"GOTO490
  54. 470 PRINT#2,CHR$(12)
  55. 480 GOTO510
  56. 490 PRINTTAB(45)"You're in the... ";:GOSUB520
  57. 500 FORX=1TO1600:NEXTX
  58. 510 CLOSE:MAXFILES=1:MENU
  59. 520 IFB<0THENPRINT"RED  "ELSEPRINT"BLACK"
  60. 530 RETURN
  61. 600 '---------------------------------
  62. 610 ' Error Processing
  63. 620 '---------------------------------
  64. 630 IFERR=52GOTO40
  65. 640 IFERR=55GOTO510
  66. 700 IFERL=260GOTO810
  67. 710 IFERL=280GOTO810
  68. 720 IFERL=320GOTO810
  69. 730 IFERL=350GOTO810
  70. 740 IFERL=360GOTO810
  71. 750 IFERL=370GOTO810
  72. 760 IFERL=380GOTO810
  73. 770 IFERL=390GOTO810
  74. 780 IFERL=400GOTO810
  75. 790 IFERL=410GOTO810
  76. 800 PRINTTAB(40)"...something is wrong!":GOTO500
  77. 810 CLS:PRINT@130,"Input error in "A$:GOTO500
  78.