ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

143 lines
4.4 KiB

  1. 1 rem This is the General Ledger Balance Sheet Printer
  2. %INCLUDE ALL.BAS
  3. 500 dim n(2,12),k$(2,10),h(9),s(9),t(4,9)
  4. RESTORE
  5. 1009 PRINT clear$:PRINT
  6. : A(9)=0
  7. 1010 PRINT "IS THIS BALANCE SHEET TO BE FOR THE MONTH TO DATE,"
  8. 1011 PRINT "QUARTER TO DATE, OR YEAR TO DATE (M, Q, OR Y)?"
  9. 1015 INPUT Z$
  10. 1017 IF ucase$(Z$)="M" THEN X=4:GOTO 1025
  11. 1020 IF ucase$(Z$)="Q" THEN X=5:GOTO 1025
  12. 1021 IF ucase$(Z$)="Y" THEN X=6:GOTO 1025
  13. 1023 GOTO 1010
  14. 1025 PRINT:PRINT"DO YOU WANT AN ORDINARY OR A COMPARATIVE"
  15. 1028 PRINT"BALANCE SHEET (O OR C) ?"
  16. 1030 INPUT U$
  17. 1050 PRINT clear$:PRINT
  18. 1075 IF ucase$(U$)="C" THEN Q$="COMPARATIVE BALANCE SHEET"
  19. 1076 IF ucase$(U$)="C" THEN GOTO 1100
  20. 1080 Q$="B A L A N C E S H E E T"
  21. 1100 REM
  22. 3000 rem READ NAME FILE SUBROUTINE
  23. 3005 a5=t%(12)
  24. 3080 Z=24:Z9=1
  25. 3090 FOR Z0=1 TO 4
  26. 3100 K$(0,Z0)=MID$(N$,Z9,Z)
  27. 3110 Z9=Z9+Z
  28. 3120 NEXT Z0
  29. 3125 rem ROUTINE TO ELIMINATE TRAILING BLANKS
  30. l8=1
  31. 3130 FOR I=1 TO 4
  32. l9=len(k$(0,i))
  33. 3140 for z=l9 to l8 step -1
  34. 3150 IF MID$(K$(0,I),Z,1)<>" " THEN 3170
  35. 3160 NEXT Z
  36. 3170 Z$=""
  37. 3180 FOR Z0=1 TO Z
  38. 3190 Z$=Z$+MID$(K$(0,I),Z0,1)
  39. 3200 NEXT Z0
  40. 3210 K$(0,I)="":K$(0,I)=Z$
  41. 3220 NEXT I
  42. 6000 rem PRINT BALANCE SHEET
  43. 6005 PRINT clear$:PRINT
  44. 6010 PRINT "PRINTING BALANCE SHEET"
  45. 6015 FOR Z=0 TO 9
  46. 6020 H(Z)=0:S(Z)=0:T(0,Z)=0:T(1,Z)=0:T(2,Z)=0:T(3,Z)=0:A(Z)=0
  47. 6025 NEXT Z
  48. 6030 T1=0:T2=0:T3=0:T4=0
  49. lprinter
  50. open "gl" recl 138 as 1
  51. open "glh" recl 150 as 2
  52. open "gls" recl 150 as 3
  53. 6200 GOSUB 9600
  54. 6250 GOSUB 10000
  55. 6255 IF N(2,2)=0 THEN 6403
  56. 6300 GOSUB 11000
  57. 6350 GOSUB 15000
  58. 6400 rem DO PARTIAL TOTALS OR TOTALS AND TEST
  59. 6403 IF N(2,2)=0 THEN FOR Z=1 TO 51-P9:print:NEXT Z:GOSUB 9800
  60. 6405 IF N(2,2)=0 THEN 20000
  61. 6410 print:print TAB(t%(6));"TOTAL "+MID$(S$,3,20);TAB(t%(7));
  62. print using l$;abs(t1):T1=0:P9=P9+1
  63. print tab(t%(7));"-------------":p9=p9+1
  64. 6415 IF ucase$(U$)<>"C" THEN 6980
  65. 6420 print TAB(t%(6));"PREVIOUS";TAB(t%(7));
  66. print using l$;abs(t3):T3=0:P9=P9+1
  67. print tab(t%(7));"-------------":p9=p9+1
  68. 6980 IF P9>51 THEN GOSUB 9700
  69. 6985 IF S(1)< H(1) THEN 6300
  70. 6990 IF S(1)=H(1) THEN GOSUB 12000
  71. 6995 GOTO 6250
  72. 9600 rem PRINT PAGE HEADING SUBROUTINE
  73. 9605 P0=1
  74. GOSUB 9610
  75. RETURN
  76. 9610 print:P9=P9+1
  77. 9615 print:P9=P9+1
  78. 9616 print TAB((t%(1)-LEN(Q$))/2);Q$:P9=P9+1
  79. 9617 print:P9=P9+1
  80. 9620 FOR Z=2 TO 4
  81. 9625 print TAB((t%(1)-LEN(K$(0,Z)))/2);K$(0,Z):P9=P9+1
  82. 9630 NEXT Z
  83. 9635 print:P9=P9+1
  84. 9640 print TAB(t%(10));"AS OF ";D$(X);TAB(t%(11));"PAGE #";P0:P9=P9+1
  85. 9645 print:P9=P9+1
  86. 9670 RETURN
  87. 9700 rem REPORT CONTINUED SUBROUTINE
  88. print:print
  89. 9710 print "report continues on next page"
  90. 9720 print chr$(12):P9=0
  91. 9725 P0=P0+1
  92. GOSUB 9610
  93. 9740 RETURN
  94. 9800 rem end of report ROUTINE
  95. 9820 print "end of report"
  96. 9840 print chr$(12)
  97. 9850 RETURN
  98. 10000 rem GET HEADING LINE AND PRINT
  99. 10005 H(9)=H(9)+1
  100. 10006 if p9>51 then gosub 9700
  101. read #2,h(9);n(2,1),n(2,2),h$,h(0),h(1),h(2),h(3), h(4),h(5),h(6),h(7)
  102. 10015 IF LEFT$(H$,2)="HS" OR LEFT$(H$,2)="HX" THEN N(2,2)=0:GOTO 10995
  103. 10020 print TAB(t%(4));mid$(h$,3,28):print:P9=P9+2
  104. 10995 RETURN
  105. 11000 rem GET SUBHEADING LINE AND PRINT
  106. 11005 S(9)=S(9)+1
  107. 11006 if p9>51 then gosub 9700
  108. read #3,s(9);n(2,1),n(2,2),s$,s(0),s(1),s(2),s(3), s(4),s(5),s(6),s(7)
  109. 11015 print:print TAB(t%(5));mid$(s$,3,28):print:P9=P9+3
  110. 11995 RETURN
  111. 12000 rem PRINT FINAL TOTAL LINE
  112. 12010 print:P9=P9+1
  113. 12020 print TAB(t%(8));"TOTAL "+MID$(H$,3,20);TAB(t%(9));
  114. print using l$;abs(t2):P9=P9+1
  115. print tab(t%(9));"=============":p9=p9+1
  116. 12025 IF ucase$(U$)<>"C" THEN 12990
  117. 12030 print TAB(t%(8));"PREVIOUS";TAB(t%(9));
  118. print using l$;abs(t4):P9=P9+1
  119. print tab(t%(9));"=============":p9=p9+1
  120. 12990 print:print:p9=p9+2:T1=0:T2=0:T3=0:T4=0
  121. 12995 RETURN
  122. 15000 rem GET ACCOUNTS IN SUBHEAD RANGE AND PRINT
  123. 15005 A(9)=A(9)+1
  124. 15006 IF P9>51 THEN GOSUB 9700
  125. read #1,a(9);n(2,1),n(2,2),k$(1,3),n(2,4),n(2,5),n(2,6), n(2,7),n(2,8),n(2,9),n(2,10)
  126. if n(2,2)=0 then 15995
  127. if n(2,x)=0 AND n(2,(x+3))=0 then 15990
  128. 15200 print TAB(t%(5)+2);K$(1,3);TAB(t%(5)+34);
  129. print using l$;abs(n(2,x)):P9=P9+1
  130. 15205 T1=T1+N(2,X):T2=T2+N(2,X):T3=T3+N(2,(X+3)):T4=T4+N(2,(X+3))
  131. 15210 IF ucase$(U$)<>"C" THEN 15990
  132. 15215 print TAB(t%(5)+2);"PREVIOUS";TAB(t%(5)+34);
  133. print using l$;abs(n(2,(x+3))):P9=P9+1
  134. 15990 IF N(2,2)< S(1) THEN 15005
  135. 15995 RETURN
  136. 20000 rem ROUTINE TO CLOSE FILES AND RETURN TO MASTER1
  137. close 1
  138. close 2
  139. close 3
  140. console
  141. 20050 CHAIN "master1"