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.
 
 
 
 
 
 

270 lines
8.1 KiB

  1. 1 rem This is the Mailing List Name Entry Program
  2. %INCLUDE ALL.BAS
  3. 500 dim k$(6,20),n(2,20)
  4. repeat$="------------------------------"
  5. fill$ = " "
  6. fmt1$="#### #### ########## /...5...10...15...20.../ "
  7. fmt2$=" "
  8. fmt2$=fmt2$+"/...5...10...15...20.../ /...5...10...15...20.../ "
  9. fmt2$=fmt2$+"/...5...10...15./ // /.../ /...5...10.../"
  10. RESTORE
  11. PRINT CLEAR$:PRINT
  12. 300 print "Enter mailing list file name as up to 4 alphanumeric characters"
  13. print:print "i.e. MA0."
  14. print:input line z5$
  15. if len(z5$)>4 then 300
  16. z5$=""+z5$
  17. z6$=z5$+"back":z7$=z5$+"size"
  18. print "Is reference no. to be zip code?";:input line temp$
  19. if ucase$(left$(temp$,1))="Y" then zip.flag=1
  20. 540 K$(6,1)="1 - NEW ENTRY":K$(6,2)=" 2 - EXAMINE EXISTING ENTRY"
  21. 550 K$(6,3)="3 - MODIFY EXISTING ENTRY"
  22. 560 K$(6,4)="4 - DELETE EXISTING ENTRY"
  23. 570 K$(6,5)="5 - CREATE NEW FILE":K$(6,6)="6 - CLEAR EXISTING FILE"
  24. 580 K$(6,7)="7 - BACK-UP AND SORT FILE":K$(6,8)="8 - LIST FILE"
  25. 590 K$(6,9)="9 - FINISHED"
  26. 1075 K$(1,1)="TAG":K$(1,2)="REFERENCE NUMBER":K$(1,3)="NAME"
  27. 1080 K$(1,4)="COMPANY":K$(1,5)="ADDRESS":K$(1,6)="CITY":K$(1,7)="STATE"
  28. 1085 K$(1,8)="ZIP CODE":K$(1,9)="PHONE (AAA) NNN NNNN"
  29. for z=1 to 9:read n(1,z):next z
  30. data 4,10,24,24,24,17,2,5,14
  31. 1100 K$(2,1)="1 - TAG":K$(2,2)="2 - REFERENCE NUMBER":K$(2,3)="3 - NAME"
  32. 1105 K$(2,4)="4 - COMPANY":K$(2,5)="5 - ADDRESS":K$(2,6)="6 - CITY"
  33. 1110 K$(2,7)="7 - STATE":K$(2,8)="8 - ZIP CODE"
  34. 1115 K$(2,9)="9 - PHONE (AAA) NNN NNNN":K$(2,10)="10- NONE"
  35. print clear$:print
  36. 1500 if end #1 then 6000
  37. open z5$ recl 150 as 1
  38. close 1
  39. open z7$ as 2
  40. read #2;z2,z3
  41. close 2
  42. 1600 REM
  43. console
  44. 1620 print clear$
  45. if z2>z3 then print "*** OUT OF RECORD SPACE ***"
  46. PRINT "MAILING LIST ENTRY PROGRAM"
  47. PRINT "--------------------------"
  48. PRINT:PRINT "THERE ARE ";Z3;" AVAILABLE RECORDS"
  49. PRINT "OF THESE THERE ARE:";TAB(30);(Z3-Z2)+1;" RECORDS OPEN"
  50. PRINT ;TAB(30);Z2-1;" RECORDS USED"
  51. PRINT
  52. 1650 PRINT "THIS IS A LIST OF OPERATIONS."
  53. 1655 PRINT
  54. 1660 FOR Z=1 TO 9:PRINT K$(6,Z):NEXT Z:PRINT
  55. 1665 PRINT "INDICATE WHAT YOU WOULD LIKE TO DO BY TYPING"
  56. 1670 PRINT "THE CORRESPONDING NUMBER."
  57. 1675 PRINT
  58. 1680 INPUT Z
  59. IF Z<1 OR Z>9 THEN 1620
  60. 1682 IF Z=1 THEN new$="N"
  61. 1685 ON Z GOSUB 2000,3000,4000,5000,6000,7000,8000,9000,10000
  62. 1690 N(2,1)=0:N(2,2)=0:N$="":new$=""
  63. 1700 FOR Z=1 TO 10:K$(3,Z)="":NEXT Z
  64. 1705 GOTO 1600
  65. 2000 IF Z2>Z3 THEN RETURN
  66. 2001 PRINT CLEAR$:PRINT
  67. 2005 PRINT "RECORD NUMBER";Z2:PRINT
  68. 2015 FOR Z=1 TO 2
  69. PRINT CUR$
  70. 2020 PRINT TAB(30);left$(repeat$,n(1,z))
  71. PRINT UP$
  72. 2025 PRINT K$(1,Z);TAB(30);
  73. 2030 INPUT line temp$:PRINT chr$(13)
  74. PRINT CLEAR$
  75. n(2,z)=val(temp$)
  76. if n(2,1)=0 then n(2,1)=z2
  77. if n(2,2)=0 then n(2,2)=z2
  78. 2035 NEXT Z
  79. 2040 FOR Z=3 TO 9
  80. PRINT CUR$
  81. 2045 PRINT TAB(30);left$(repeat$,n(1,z))
  82. PRINT UP$
  83. 2050 PRINT K$(1,Z);TAB(30);
  84. 2055 INPUT line K$(3,Z):PRINT chr$(13)
  85. if len(k$(3,z))>n(1,z) then k$(3,z)=left$(k$(3,z),n(1,z))
  86. 2060 I=(N(1,Z)-LEN(K$(3,Z))):K$(3,Z)=K$(3,Z)+left$(fill$,i)
  87. PRINT CLEAR$
  88. if zip.flag=1 then n(2,2)=val(k$(3,8))
  89. 2065 NEXT Z
  90. 2066 N$=""
  91. 2070 FOR Z=3 TO 9:N$=N$+K$(3,Z):NEXT Z
  92. 2100 Z1=Z2
  93. 2105 PRINT clear$:PRINT
  94. 2110 PRINT "RECORD NUMBER";Z1:PRINT
  95. 2115 FOR Z=1 TO 2
  96. 2120 PRINT K$(2,Z);TAB(30);N(2,Z)
  97. 2125 NEXT Z
  98. 2130 FOR Z=3 TO 10
  99. 2135 PRINT K$(2,Z);TAB(30);K$(3,Z)
  100. 2140 NEXT Z
  101. 2145 PRINT
  102. 2150 PRINT "IF AN ITEM IS TO BE CHANGED, TYPE THE APPROPRIATE NUMBER."
  103. 2155 PRINT:INPUT Z
  104. 2160 PRINT
  105. 2165 IF Z>9 THEN 2216
  106. 2170 IF Z<1 THEN 2105
  107. 2175 IF Z>2 THEN 2200
  108. 2180 PRINT TAB(30);left$(repeat$,n(1,z))
  109. PRINT UP$
  110. 2185 PRINT K$(1,Z);TAB(30);
  111. 2190 INPUT N(2,Z)
  112. 2195 GOTO 2225
  113. 2200 PRINT TAB(30);left$(repeat$,n(1,z))
  114. PRINT UP$
  115. 2205 PRINT K$(1,Z);TAB(30);
  116. 2210 INPUT line K$(3,Z)
  117. if len(k$(3,z))>n(1,z) then k$(3,z)=left$(k$(3,z),n(1,z))
  118. 2215 I=(N(1,Z)-LEN(K$(3,Z))):K$(3,Z)=K$(3,Z)+left$(fill$,i)
  119. 2216 N$=""
  120. 2220 FOR I=3 TO 9:N$=N$+K$(3,I):NEXT I
  121. 2225 INPUT "ANY MORE CHANGES";line temp$
  122. 2230 IF ucase$(left$(temp$,1))="Y" then 2105
  123. 2235 print
  124. 2240 INPUT "IS RECORD TO BE ENTERED";line temp$
  125. 2245 print
  126. 2250 if ucase$(left$(temp$,1))="Y" then 2280
  127. 2255 if ucase$(left$(temp$,1))<>"N" then 2235
  128. 2260 print clear$:print
  129. 2270 print "*** RECORD NOT ENTERED ***":print:print
  130. 2275 for z=1 to 200:next z:return
  131. 2280 open z5$ recl 150 as 1
  132. print #1,z1;n(2,1),n(2,2),n$
  133. close 1
  134. 2295 if new$="N" then z2=z2+1:open z7$ as 1:print #1;z2,z3:close 1
  135. 2300 return
  136. 3000 print clear$:print
  137. 3005 input "RECORD NUMBER";z1
  138. 3010 if z1>=z2 then 3000
  139. 3012 if z1<1 then return
  140. 3015 open z5$ recl 150 as 1
  141. read #1,z1;n(2,1),n(2,2),n$
  142. close 1
  143. 3030 print
  144. 3035 for z=1 to 2
  145. 3040 print k$(1,z);tab(30);n(2,z)
  146. 3045 next z
  147. 3046 z9=1
  148. 3050 for z=3 to 9
  149. 3055 print k$(1,z);tab(30);mid$(n$,z9,n(1,z))
  150. 3060 z9=z9+n(1,z)
  151. 3065 next z
  152. 3070 print
  153. 3075 print "FOR A NEW RECORD NUMBER, TYPE N - RETURN.":PRINT
  154. 3080 PRINT "IF FINISHED, TYPE F - RETURN.":PRINT
  155. 3085 input line temp$
  156. 3090 if ucase$(temp$)="N" then 3000
  157. 3095 return
  158. 4000 print clear$:print
  159. 4005 N$=""
  160. 4010 input "RECORD NUMBER";z1
  161. 4015 if z1<1 then print "*** NO SUCH RECORD ***":goto 1620
  162. 4020 if z1>z3 then print "*** OUT OF RANGE ***":goto 1620
  163. 4025 if z1>=z2 then print "NO RECORD NUMBER";Z1:goto 1620
  164. 4030 open z5$ recl 150 as 1
  165. read #1,z1;n(2,1),n(2,2),n$
  166. close 1
  167. 4045 if n(2,1) = 0 then print "*** DELETED RECORD ***":GOTO 1620
  168. 4050 Z9=1
  169. 4055 FOR Z=3 TO 9
  170. 4060 K$(3,Z)=MID$(N$,Z9,N(1,Z))
  171. 4065 Z9=Z9+N(1,Z)
  172. 4070 NEXT Z
  173. 4075 GOTO 2105
  174. 5000 PRINT clear$:print
  175. 5010 input "RECORD NUMBER";z1
  176. 5015 if z1<1 then print "*** NO SUCH RECORD ***":goto 1620
  177. 5020 if z1>z3 then print "*** OUT OF RANGE ***":goto 1620
  178. 5025 if z1>=z2 then print "NO RECORD NUMBER";Z1:goto 1620
  179. 5030 open z5$ recl 150 as 1
  180. read #1,z1;n(2,1),n(2,2),n$
  181. close 1
  182. 5045 if n(2,1) = 0 then print "*** DELETED RECORD ***":GOTO 1620
  183. 5050 print
  184. 5055 for z=1 to 2
  185. 5060 print k$(1,z);tab(30);n(2,z)
  186. 5065 next z
  187. 5070 Z9=1
  188. 5055 FOR Z=3 TO 9
  189. 5080 print k$(1,z);tab(30);mid$(n$,z9,n(1,z))
  190. 5085 Z9=Z9+N(1,Z)
  191. 5090 NEXT Z
  192. 5095 print
  193. 5100 input "IS RECORD TO BE DELETED (MUST BE YES TO DELETE)";line temp$
  194. 5105 if ucase$(left$(temp$,1))="N" then return
  195. 5110 if ucase$(temp$)<> "YES" then 5095
  196. 5115 n(2,1)=0
  197. 5120 open z5$ recl 150 as 1
  198. print #1,z1;n(2,1),n(2,2),n$
  199. close 1
  200. 5135 return
  201. 6000 print clear$:print
  202. 6005 print "IF YOU HAVE ARRIVED HERE AND HAVE THIS MAILING LIST FILE"
  203. 6010 print "ALREADY ON A DISK, YOU SHOULD INSTALL THAT DISK THEN"
  204. 6016 print "TYPE THE LETTER C FOLLOWED BY A RETURN TO CONTINUE."
  205. 6020 print
  206. 6025 print "IF YOU WISH TO CREATE A NEW FILE, TYPE THE LETTER N"
  207. 6030 print "FOLLOWED BY RETURN.":print
  208. 6035 input line temp$
  209. 6040 if ucase$(temp$)="C" then initialize:goto 1500
  210. 6045 print clear$:print
  211. 6050 input "NUMBER OF RECORDS DESIRED";z3
  212. 6055 print
  213. 6060 n$="":for z=1 to 100:n$=n$+" ":next z:n(2,1)=0:n(2,2)=0
  214. 6065 create z5$ recl 150 as 1
  215. 6070 for z1=1 to z3+2
  216. print #1,z1;n(2,1),n(2,2),n$
  217. 6085 next z1
  218. 6090 close 1
  219. 6095 print clear$:print
  220. 6100 print "MAILING LIST FILE ";MID$(Z5$,3,4);" CREATED AND CLEARED.":PRINT
  221. 6105 PRINT z3;"RECORDS CREATED.":PRINT
  222. 6110 PRINT "TO CONTINUE, TYPE RETURN.":INPUT line temp$
  223. z2=1
  224. create z7$ as 1:print #1;z2,z3:close 1
  225. 6115 goto 1500
  226. 7000 n$="":for z=1 to 100:n$=n$+" ":next z:n(2,1)=0:n(2,2)=0
  227. 7006 input "ARE YOU SURE !!! (YES OR NO)";line temp$
  228. 7007 if ucase$(temp$)<> "YES" then return
  229. open z5$ recl 150 as 1
  230. 7010 for z1=1 to z3+2
  231. print #1,z1;n(2,1),n(2,2),n$
  232. 7025 next z1
  233. 7030 close 1
  234. 7035 print clear$:print
  235. 7040 print "MAILING LIST FILE ";mid$(z5$,3,4);" CLEARED!":PRINT
  236. 7045 print "TO CONTINUE, TYPE RETURN."
  237. 7050 INPUT line temp$
  238. z2=1
  239. open z7$ as 1:print #1;z2,z3:close 1
  240. 7060 return
  241. 8000 chain "MASORT"
  242. 9000 print clear$:print
  243. 9010 input "Enter number of lines per page.";page
  244. 9015 page1=1
  245. 9020 print clear$:print
  246. 9030 lprinter
  247. 9035 open z5$ recl 150 as 1
  248. 9040 for z1=1 to z2-1
  249. 9045 read #1,z1;n(2,1),n(2,2),n$
  250. 9050 z9=1
  251. 9055 for z=3 to 9
  252. 9060 k$(3,z)=mid$(n$,z9,n(1,z))
  253. 9065 z9=z9+n(1,z)
  254. 9070 next z
  255. 9100 print using fmt1$;z1,n(2,1),n(2,2),k$(3,3)
  256. 9101 print using fmt2$;k$(3,4),k$(3,5),k$(3,6),k$(3,7),k$(3,8),k$(3,9)
  257. 9105 page1=page1+2
  258. 9110 if page1>page then print chr$(12):page1=1
  259. 9120 next z1
  260. 9150 print chr$(12):for z=1 to 100:next z:print chr$(12)
  261. console
  262. 9155 return
  263. 10000 chain "master6"