home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / basic / prebas.lbr / PREBAS.DQC / PREBAS.DOC
Encoding:
Text File  |  1985-03-18  |  21.6 KB  |  582 lines

  1. áááááááááááááááááááááááááááááááá PREBA╙ì
  2. áááááááááááááááááááááááááááááááá =====╜
  3.  
  4. áááááááááááááááááááááá ┴ pre-processo≥ fo≥ BASIC«ì
  5. áááááááááááááááááááááá -------------------------¡
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13. Copyrigh⌠ (c⌐ 198╡ b∙ Greywolf«ì
  14. Las⌠ revisioε t∩ thi≤ document║ Jaε 2░ 1985«
  15.  
  16. PREBA╙á take≤ ß fla⌠ ASCI╔ file¼á add≤ linσ number≤ t∩á it¼á and¼ ì
  17. optionally¼á resolve≤á reference≤ t∩ targe⌠ labels«á I⌠ caεá als∩ ì
  18. resolvσá thσá label≤á withou⌠ linσ numbers¼á o≥á stri≡á olΣá linσ ì
  19. number≤á ou⌠á oµ ß file«á PREBA╙ i≤ intendeΣ a≤ aε aiΣá t∩á BASI├ ì
  20. programmers«á WitΦá i⌠ the∙ caε ente≥ ß prograφ iε thei≥ favoritσ ì
  21. tex⌠á edito≥á o≥ worΣ processor¼á whilσ no⌠ worryinτá abou⌠á linσ ì
  22. numbers¼á o≥ thσ target≤ fo≥ thei≥ GOT╧ anΣ GOSU┬ statements«á I⌠ ì
  23. ha≤ ß numbe≥ oµ options¼ including:
  24.  
  25. áááá addinτ linσ number≤ì
  26. áááá resolvinτ label≤ì
  27.      strippinτá olΣá linσá number≤á 
  28.      selectioεá oµá thσá star⌠á numbe≥ ì
  29.      selectioε oµ thσ ste≡ sizσ selectioε oµ thσ labe∞ marke≥ 
  30.      additioε oµ comment≤ t∩ thσ enΣ oµ ß line¼á 
  31.      showinτ targe⌠ label≤á 
  32.      commanΣ linσ executioε (no⌠ ye⌠ availablσ iε MS/DO╙ version)
  33.  
  34.  
  35. PREBA╙á wa≤ writteε iε Microsof⌠ BASI├ (MBASIC⌐ anΣ wa≤á compileΣ ì
  36. witΦ BASCOM« Therσ arσ threσ files:
  37.  
  38. áááá PREBAS.DO├ -¡ Thi≤ document«ì
  39. áááá PREBAS.CO═ -¡ Thσ compileΣ executablσ prograφ (linkeΣ t∩ ì
  40. áááááááááááááááááá OBSLIB.REL)«ì
  41. áááá PREBAS.BA╙ -¡ Thσ BASI├ sourcσ code«
  42.  
  43. Note║á ╔á includσá thσ BASI├ sourcσ s∩ tha⌠ thσ default≤á caεá bσ ì
  44. changeΣá (seσ Appendi° ┴ -- Customization⌐ o≥ s∩ tha⌠ PREBA╙á caε ì
  45. bσ recompileΣ t∩ ruε unde≥ thσ BRU╬ run-timσ library« PREBA╙ doe≤ ì
  46. ruεá unde≥ thσ interpreter¼á bu⌠ run≤ ver∙ slowl∙ (especiall∙á iµ ì
  47. yo⌡áá arσá resolvinτá labels)«áá PREBA╙á translate≤á line-by-linσ ì
  48. (writinτ eacΦ linσ ou⌠ t∩ thσ ne≈ file)¼á rathe≥ thaε iεá RAM«á ╔ ì
  49. fel⌠á tha⌠á speeΣá wa≤ les≤ importan⌠ thaε ß limitatioεá oµá sizσ ì
  50. imposeΣ b∙ thσ sizσ oµ RAM«á However¼á PREBA╙ i≤ stil∞ limiteΣ b∙ ì
  51. disδ capacity¼á needinτ rooφ fo≥ ß filσ a⌠ leas⌠ thσ samσ sizσ a≤ ì
  52. thσ inpu⌠ file.
  53.  
  54.  
  55.  
  56. èáááááááááááááááááááááááááááá RUNNIN╟ PREBA╙ì
  57. áááááááááááááááááááááááááááá =============╜
  58.  
  59. Thσ simples⌠ wa∙ t∩ executσ PREBA╙ i≤ froφ thσ commanΣ linσ usinτ ì
  60. thσ standarΣ defaults║ 
  61. A>PREBA╙ B:TEXT
  62.  
  63. Thi≤á woulΣ takσ aε ASCI╔ (non-document⌐ filσá calleΣá TEST¼á anΣ ì
  64. creatσ ß ne≈ filσ oε thσ B║á drivσ calleΣ TEST.BAS« Thi≤ ne≈ filσ ì
  65. woulΣ havσ linσ number≤ a⌠ thσ star⌠ oµ eacΦ line¼á startinτ witΦ ì
  66. 1░ anΣ incrementinτ b∙ 1░ eacΦ time« Aε "'ó wil∞ bσ inserteΣ int∩ ì
  67. an∙ linσ startinτ witΦ ß labe∞ (identifieΣ b∙ aε "@ó a≤ it≤ firs⌠ ì
  68. character.⌐á An∙ reference≤ t∩ tha⌠ labe∞ wil∞ bσ translateΣ int∩ ì
  69. reference≤ t∩ thσ actua∞ linσ number«á AppendeΣ t∩ thσ enΣ oµ an∙ ì
  70. linσá containinτ reference≤ t∩ targe⌠ label≤ wil∞ bσá óá '^ITO:"¼ ì
  71. theε thσ lis⌠ oµ origina∞ referencσ label≤ separateΣ b∙ commas.
  72.  
  73. Fo≥ example¼ Sa∙ wσ haΣ ß filσ calleΣ TES╘ tha⌠ lookeΣ likσ this║
  74.  
  75. '-----------------------------------------------------------¡ì
  76. ºáááááááááááááá @TES╘ -¡ ┴ tes⌠ fo≥ PREBA╙ì
  77. ºì
  78. '-----------------------------------------------------------¡ì
  79. @STAR╘ -¡ Thi≤ i≤ thσ star⌠ oµ thσ program«ì
  80. FO╥ ╩ ╜ ▒ T╧ 2░ì
  81. ááááááá GOSU┬ @ROUTIN┼ì
  82. NEX╘ ╩ì
  83. ºì
  84. INPU╘ "D╧ YO╒ WAN╘ T╧ EXIT"╗ Añì
  85. I╞ Añ ╜ "Yó THE╬ GOT╧ @EN─ ELS┼ GOT╧ @STAR╘ì
  86. ºì
  87. @EN─ì
  88. ºì
  89. EN─ì
  90. ºì
  91. ºì
  92. @ROUTINō
  93. PRIN╘ "INSID┼ ROUTINEóì
  94. RETUR╬
  95.  
  96. Thσ command║ì
  97. A>PREBA╙ B:TES╘ ì
  98. woulΣ producσ ß filσ calleΣ TEST.BA╙ tha⌠ lookeΣ likσ this║
  99.  
  100. 1░ '-----------------------------------------------------------¡ì
  101. 2░ ºááááááááááá @TES╘ -¡ ┴ tes⌠ fo≥ PREBA╙ì
  102. 3░ ºì
  103. 4░ '-----------------------------------------------------------¡ì
  104. 5░ '@STAR╘ -¡ Thi≤ i≤ thσ star⌠ oµ thσ program«ì
  105. 6░ FO╥ ╩ ╜ ▒ T╧ 2░ì
  106. 7░ááááá GOSU┬ 18░ ºáááá TO║ @ROUTIN┼ì
  107. 8░ NEX╘ ╩ì
  108. 9░ ºì
  109. 10░ INPU╘ "D╧ YO╒ WAN╘ T╧ EXIT"╗ Añì
  110. 11░ I╞ Añ ╜ "Yó THE╬ GOT╧ 13░ ELS┼ GOT╧ 5░ ºááá TO║ @END¼ @STAR╘ìè12░ ºì
  111. 13░ '@EN─ì
  112. 14░ º
  113. 15░ EN─ì
  114. 16░ ºì
  115. 17░ ºì
  116. 18░ '@ROUTIN┼ì
  117. 19░ PRIN╘ "INSID┼ ROUTINEóì
  118. 20░ RETUR╬
  119.  
  120. ┴á morσá comple° examplσ caε bσ founΣ iε Appendi°á B«á Also¼á thσ ì
  121. sourcσ filσ (PREBAS.BAS)¼ froφ @PARSEC╠ oε down¼ wa≤ processeΣ b∙ ì
  122. PREBAS.
  123.  
  124.  
  125.  
  126. LABELS║ì
  127. =====╜
  128.  
  129. PREBA╙ recognize≤ label≤ if¼á (A)║á thei≥ firs⌠ characte≥ i≤á thσ ì
  130. marke≥ character¼á anΣ (B)║ the∙ arσ wholσ words« Fo≥ instancσ -- ì
  131. supposσá yo⌡ arσ ß Cromemc∩ Sbasiπ faε (a≤ ╔ am)¼á anΣ yo⌡á chosσ ì
  132. "*óá a≤ you≥ marke≥ character«á PREBA╙ wil∞ bσ ablσ t∩ tel∞á tha⌠ ì
  133. "*Getcharóá i≤ ß label¼á anΣ wil∞ no⌠ bσ confuseΣ b∙ "32▒ ¬á 42"¼ ì
  134. "4*8"¼á o≥ "18¬ 47/6"« I⌠ WIL╠ ge⌠ confuseΣ b∙ somethinτ like║ "▓ ì
  135. *853"¼á thinkinτá tha⌠ *85│ i≤ ß label«á However¼á al∞ tha⌠á wil∞ ì
  136. happeεá i≤ yo⌡ wil∞ ge⌠ thσ message║á *84│ A╘ LIN┼ 20░á -- TARGE╘ ì
  137. NO╘ FOUN─ durinτ pas≤ two¼á anΣ thσ "*843ó wil∞ remaiε untouched« ì
  138. Unless¼ oµ course¼ yo⌡ werσ foolisΦ enougΦ t∩ labe∞ ß targe⌠ linσ ì
  139. witΦ thσ label║ "*843"
  140.  
  141.  
  142. PREBA╙á recognizσ a≤ ß targe⌠ linσ an∙ linσ wherσ thσ firs⌠ word¼ ì
  143. (whethe≥ precedeΣ b∙ whitσ space¼á o≥ not)¼á i≤ ß labe∞ (ha≤á thσ ì
  144. marke≥á characte≥á a≤ it≤ firs⌠ char.)«á Iµ therσá arσá duplicatσ ì
  145. labels¼ thσ firs⌠ onσ wil∞ bσ useΣ a≤ thσ target.
  146.  
  147.  
  148.  
  149. ááááááááááááááááááááá RUNNIN╟ PREBA╙ WIT╚ PROMPT╙ì
  150. ááááááááááááááááááááá ==========================╜
  151.  
  152.  
  153. Iµ yo⌡ arσ unfamilia≥ witΦ thσ commanΣ linσ synta° oµ PREBAS¼ yo⌡ ì
  154. caε havσ i⌠ promp⌠ yo⌡ fo≥ thσ informatioε yo⌡ need«á Yo⌡ d∩ thi≤ ì
  155. b∙áá jus⌠áá enterinτá it≤á namσá oεá thσáá commanΣáá line«áá e.g« ì
  156. A>PREBAS<RETURN╛á (Or¼á iµá runninτá thσá BASI├á sourcσá program¼ ì
  157. A>MBASI├ PREBAS)«á PREBA╙ wil∞ theε asδ ß serie≤ oµ questions« A⌠ ì
  158. an∙ time¼ yo⌡ caε abor⌠ thσ process¼ b∙ typinτ "Xó iε responsσ t∩ ì
  159. ß question¼á anΣ PREBA╙ wil∞ abor⌠ thσ presen⌠ translation¼á theε ì
  160. asδ yo⌡ iµ yo⌡ wan⌠ t∩ d∩ anothe≥ file« Iµ yo⌡ answe≥ "Nó t∩ thi≤ ì
  161. question¼á yo⌡ wil∞ exi⌠ froφ PREBAS¼ otherwisσ yo⌡ caε star⌠ al∞ ì
  162. over.
  163.  
  164. Afte≥áá givinτá PREBA╙á thσá inpu⌠á filσá anΣá thσá outpu⌠á file¼ ìèrespondinτá witΦá aεá escapσá <ESC╛ t∩á ßá yes/n∩á questioεá wil∞ ì
  165. immediatel∙ star⌠ thσ translatioε usinτ thσ presen⌠ se⌠á options« ì
  166. Iµá thi≤ i≤ thσ firs⌠ translatioε yo⌡ arσ doinτ iε thi≤á session¼ ì
  167. theε thosσ option≤ wil∞ bσ thσ defaul⌠ options«á Otherwise¼á the∙ ì
  168. wil∞ bσ thσ one≤ yo⌡ chosσ oε you≥ las⌠ translation« 
  169.  
  170. Herσ arσ thσ question≤ PREBA╙ wil∞ ask║
  171.  
  172. WHA╘ I╙ TH┼ NAM┼ O╞ TH┼ INFILE?║
  173.  
  174. Herσáá yo⌡á givσá PREBA╙á thσá namσá oµá thσá tex⌠áá file¼áá e.g« ì
  175. B:TEST<RETURN>
  176.  
  177. WHA╘ I╙ TH┼ NAM┼ O╞ TH┼ OUTFIL┼ (<CR╛ FO╥ B:TEST.BAS)?║
  178.  
  179. Herσá yo⌡ givσ PREBA╙ thσ namσ oµ thσ filσ iε whicΦ yo⌡ wan⌠á thσ ì
  180. linσ number≤ t∩ appear« Yo⌡ caε jus⌠ hi⌠ <return╛ fo≥ thσ defaul⌠ ì
  181. oµá you≥ infilσ witΦ extensioε .BAS¼á saveΣ oε thσ samσ drivσá a≤ ì
  182. you≥á infile«á Iµá yo⌡ chosσ exactl∙ thσ samσá name¼á drive¼á anΣ ì
  183. extensioε a≤ thσ infile¼á (yo⌡ caε choosσ aε extensioε oµ nothinτ ì
  184. b∙á followinτá thσá filenamσ b∙ ß period)¼á thσá infilσá wil∞á bσ ì
  185. replaceΣ b∙ thσ outfile«á ╔ d∩ no⌠ recommenΣ thi≤ procedure«á (I⌠ ì
  186. doe≤á no⌠ savσ an∙ disδ space«á Thσ outpu⌠ i≤ writteε t∩á ßá filσ ì
  187. witΦá thσá samσá name¼á bu⌠ witΦ extensioε .TMP«á Thσá infilσá i≤ ì
  188. killed¼á theε thσ .TM╨ filσ i≤ renameΣ t∩ thσ namσ oµ thσ outfilσ ì
  189. -- which¼ iε thi≤ case¼ i≤ thσ samσ a≤ thσ infile« Yo⌡ stil∞ neeΣ ì
  190. a≤ mucΦ disδ spacσ a≤ yo⌡ woulΣ copyinτ t∩ anothe≥ filename.⌐á Iµ ì
  191. thσ infilσ anΣ thσ outfilσ differ¼á theε thσ infilσ i≤ preserved¼ ì
  192. anΣ an∙ error≤ (sucΦ a≤ "LABE╠ NO╘ FOUND"⌐ caε bσ easil∙ fixed.
  193.  
  194. D╧ YO╒ WAN╘ T╧ AD─ LIN┼ NUMBERS┐
  195.  
  196. Answe≥ "Yó o≥ <RET╛ iµ yo⌡ wan⌠ t∩ havσ linσ number≤ added«
  197.  
  198. D╧ YO╒ WAN╘ T╧ RESOLV┼ LABELS┐
  199.  
  200. Answe≥á "Yóá o≥á <RET╛ t∩ thi≤ iµ yo⌡ havσ label≤á iεá thσá file« ì
  201. Otherwise¼á answe≥ "N"¼ becausσ processinτ wil∞ bσ mucΦ faste≥ iµ ì
  202. PREBA╙ doe≤ no⌠ havσ t∩ resolvσ labels.
  203.  
  204. Iµ yo⌡ answe≥ "Y"¼ yo⌡ wil∞ seσ thσ nex⌠ tw∩ question║
  205.  
  206. WHA╘ I╙ TH┼ MARKE╥ CHARACTE╥ (<CR╛ FO╥ @)?║ 
  207.  
  208. Iµá you≥á label≤ star⌠ witΦ ß differen⌠ marke≥ (sucΦ a≤á *LABEL)¼ ì
  209. theεá ente≥á tha⌠ characte≥ here«á Iµ yo⌡ ente≥á aεá alphabetica∞ ì
  210. character¼á yo⌡ wil∞ bσ tolΣ "INVALI─ MARKER"¼á theε yo⌡ wil∞á bσ ì
  211. askeΣ again.
  212.  
  213.  
  214. AD─ COMMENT╙ T╧ EN─ O╞ LINES┐ì
  215. (e.g« 'TO║ @LABEL1¼ @LABEL2...')║
  216.  
  217. Iµá yo⌡ answe≥ "Yó o≥ <CR╛ t∩ this¼á al∞ reference≤ wil∞ bσ addeΣ ì
  218. a≤á comment≤ t∩ thσ enΣ oµ lines«á Fo≥ example║á 
  219. èGOSU┬á @GETCHAR║ ì
  220. GOT╧ @NEX╘ Wil∞ resolvσ to║ 3░ GOSU┬ 400║ GOT╧ 5░ º TO║ @GETCHAR¼ ì
  221. @NEXT
  222.  
  223.  
  224. Iµ yo⌡ answereΣ n∩ t∩ linσ number≤ anΣ labels¼á ß bel∞ wil∞ ring¼ ì
  225. anΣ yo⌡ wil∞ bσ askeΣ thσ followinτ question:
  226.  
  227. D╧ YO╒ WAN╘ T╧ STRI╨ LIN┼ NUMBER╙ FRO═ B:TES╘ì
  228. (TYP┼ ╬ T╧ CHANG┼ YOU╥ MIND¼ ╪ T╧ CHANG┼ FILENAMES)║
  229.  
  230. Iµ yo⌡ arσ no⌠ addinτ linσ number≤ o≥ labels¼ PREBA╙ presume≤ thσ ì
  231. onl∙ reasoε yo⌡ woulΣ havσ fo≥ processinτ ß filσ i≤ tha⌠ yo⌡ wan⌠ ì
  232. t∩á stri≡ olΣ linσ numbers«á Answe≥ ye≤ to∩ thi≤á anΣá processinτ ì
  233. wil∞ begiε immediately« Yo⌡ shoulΣ seσ thσ message:
  234.  
  235. HAV┼ FOUN─ LIN┼ NUMBER╙ I╬ B:TEST.BA╙ì
  236. STRIPPIN╟ AN─ WRITIN╟ T╧ B:TEST«
  237.  
  238. However¼á shoulΣá therσá bσá n∩ linσ number≤ iεá thσá infile¼á n∩ ì
  239. outfilσ wil∞ bσ created¼ thσ bel∞ wil∞ ring¼ anΣ yo⌡ wil∞ seσ thσ ì
  240. message:
  241.  
  242. COUL─ NO╘ FIN─ AN┘ LIN┼ NUMBER╙ I╬ B:TES╘
  243.  
  244. Note║á Bσ carefu∞ witΦ stripping« An∙ absolutσ reference≤ t∩ linσ ì
  245. number≤á (o≥ previousl∙ PREBASeΣ labels⌐ wil∞ no≈ bσá meaningles≤ ì
  246. (havσ n∩ targets).
  247.  
  248.  
  249. Iµá yo⌡á answereΣ "Yó t∩ linσ numberinτ o≥ t∩á labe∞á resolution¼ ì
  250. (eveεá iµ yo⌡ answereΣ n∩ t∩ linσ numbering)¼á yo⌡ wil∞á seσá thσ ì
  251. nex⌠ tw∩ questions« (Label≤ wil∞ bσ resolveΣ a≤ iµ therσ wa≤ linσ ì
  252. numbering¼á s∩á therσá stil∞ i≤ ß neeΣ fo≥ ß star⌠ numbe≥á anΣá ß ì
  253. stepsize.)
  254.  
  255. WHA╘ I╙ TH┼ STAR╘ NUMBE╥ (<CR╛ FO╥ 10)║
  256.  
  257. Thi≤ i≤ thσ numbe≥ you≥ firs⌠ linσ wil∞ have«á Normally¼ yo⌡ wil∞ ì
  258. wan⌠á thi≤ t∩ bσ 10¼á bu⌠ fo≥ somσ application≤ yo⌡ migh⌠ wan⌠ t∩ ì
  259. se⌠ thi≤ numbe≥ mucΦ higher«á (If¼á fo≥ instance¼á yo⌡ intenΣá t∩ ì
  260. MERG┼ thσ presen⌠ modulσ int∩ anothe≥ BASI├ program.)
  261.  
  262. WHA╘ I╙ TH┼ STE╨ SIZ┼ (<CR╛ FO╥ 10)║
  263.  
  264. Thi≤á i≤á thσ incremen⌠ valuσ (thσ numbe≥ tha⌠ wil∞ bσá addeΣá t∩ ì
  265. eacΦá linσ numbe≥ t∩ makσ thσ nex⌠ linσá number)«á Normally¼á yo⌡ ì
  266. wil∞ wan⌠ thi≤ t∩ bσ 10.
  267.  
  268.  
  269. ááááááááááááááááá ===================================╜
  270.  
  271. Oncσá yo⌡ havσ answereΣ al∞ thσ question≤ (o≥ hi⌠ <ESC>)¼á PREBA╙ ì
  272. wil∞á begiε thσ translation¼á keepinτ yo⌡ informeΣ oµ wha⌠ i⌠á i≤ ì
  273. doing.
  274. è
  275. Iµ yo⌡ arσ onl∙ addinτ linσ numbers¼á yo⌡ wil∞ seσ thσá followinτ ì
  276. display:
  277.  
  278. WRITIN╟ TES╘ T╧ TEST.BA╙ WIT╚ LIN┼ NUMBER╙á 1░ ¼ 1░
  279.  
  280. Thσá tw∩á number≤ oε thσ enΣ arσ thσ star⌠ number¼á anΣ thσá ste≡ ì
  281. size.
  282.  
  283. Iµ yo⌡ arσ resolvinτ label≤ iε thσ file¼ yo⌡ wil∞ see║
  284.  
  285. PAS╙ ONE║ RESOLVIN╟ LABEL╙ I╬ B:TES╘ MARKE─ B┘ └
  286.  
  287. Then║
  288.  
  289. PAS╙ TWO║ì
  290. WRITIN╟ B:TES╘ T╧ B:TEST.BA╙ WIT╚ LIN┼ NUMBER╙ 1░ ¼ 1░ì
  291. WIT╚ LABE╠ RESOLUTION« -¡ MARKE╥ ╜ └ì
  292. PLEAS┼ WAI╘
  293.  
  294. Iµá you≥ filσ i≤ ß biτ one¼á thi≤ migh⌠ takσ ß weσ while¼á s∩á bσ ì
  295. patien⌠á (especiall∙á iµ you'rσ runninτ unde≥á thσá interpreter)« ì
  296. Note║á Iµá you≥ operatinτ systeφ ha≤ disδ caching¼á likσ CPM½á o≥ ì
  297. largσ memor∙ MS/DOS¼á yo⌡ migh⌠ no⌠ seσ mucΦ disδ activit∙ fo≥á ß ì
  298. while« Don'⌠ worry¼ PREBA╙ i≤ stil∞ running.
  299.  
  300. EacΦá timσá PREBA╙á find≤ ß referencσ labe∞á withou⌠á ßá matchinτ ì
  301. targe⌠ label¼ yo⌡ wil∞ bσ tolΣ abou⌠ it¼ e.g.:
  302.  
  303. @LABE╠ -¡ oε linσ 45░ -¡ no⌠ found«
  304.  
  305. Iµá PREBA╙ find≤ an∙ linσ number≤ alread∙ iε thσ infile¼á i⌠ wil∞ ì
  306. hal⌠ processing¼ rinτ thσ bell¼ anΣ ask:
  307.  
  308. WARNIN╟ -¡ numbereΣ line≤ alread∙ iε thσ file¼ì
  309. B:TES╘ startinτ a⌠ linσ numbe≥ 35░ì
  310. D∩ yo⌡ wisΦ t∩ proceeΣ (strip/overwritσ olΣ numbers⌐ ┐ì
  311. (Inpu⌠ 'Yº t∩ proceeΣ -¡ anythinτ elsσ wil∞ abort)║
  312.  
  313. Iµ yo⌡ typσ "Yó here¼ thσ olΣ linσ number≤ wil∞ bσ overwritteε b∙ ì
  314. thσ ne≈ one≤ -- bu⌠ remember¼ thσ samσ cautioε tha⌠ wa≤ giveε fo≥ ì
  315. strippinτ olΣ linσ number≤ applie≤ here.
  316.  
  317. Iµá yo⌡á typσ anythinτ elsσ thaεá "Y"¼á yo⌡á wil∞á see║á "PROCES╙ ì
  318. ABORTED"¼ anΣ yo⌡ wil∞ bσ askeΣ iµ yo⌡ wan⌠ t∩ d∩ anothe≥ file.
  319.  
  320. Afte≥ PREBA╙ ha≤ finisheΣ processinτ you≥ file¼ yo⌡ wil∞ see║
  321.  
  322. PROCESSE─ 3╕ LINES¼ NUMBERE─ FRO═ 1░ T╧ 38░
  323.  
  324. D╧ YO╒ WAN╘ T╧ NUMBE╥ ANOTHE╥ FIL┼ (Y/N)┐ 
  325.  
  326. Answe≥á "Yó t∩ thi≤ anΣ PREBA╙ wil∞ star⌠ askinτ question≤á abou⌠ ì
  327. thσá nex⌠á cop∙á (witΦá thσ option≤ yo⌡ chosσ iεá thσá las⌠á pas≤ ì
  328. througΦ a≤ thσ ne≈ defaul⌠ options)«á Answe≥ anythinτá else¼á anΣ ìèyo⌡ wil∞ bσ returneΣ t∩ you≥ operatinτ system.
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335. áááááááááááááááá EXECUTIN╟ PREBA╙ FRO═ TH┼ COMMAN─ LIN┼ì
  336. áááááááááááááááá =====================================╜
  337.  
  338.  
  339. PREBA╙á caε bσ executeΣ froφ thσ commanΣ line¼á witΦ ful∞ contro∞ ì
  340. oµá al∞á thσ options«á Thi≤ allow≤ fo≥ eas∙ inclusioεá oµá PREBA╙ ì
  341. command≤á iε submi⌠ (batch⌐ files«á However¼á thσ PREBA╙á commanΣ ì
  342. linσ optioε presume≤ yo⌡ kno≈ wha⌠ yo⌡ arσ doing«á Therσ i≤á les≤ ì
  343. erro≥ checkinτ thaε therσ i≤ iε thσ promp⌠ mode¼á anΣ i⌠ wil∞ no⌠ ì
  344. asδá yo⌡á iµ thi≤ i≤ REALL┘ wha⌠ yo⌡ intendeΣ t∩ d∩á wheεá you'rσ ì
  345. overwritinτá ß filσ o≥ linσ number≤ alread∙ exist«á Afte≥á PREBA╙ ì
  346. execute≤á froφá thσ commanΣ line¼á i⌠ return≤ yo⌡ t∩ thσá commanΣ ì
  347. leve∞ (yo⌡ d∩ no⌠ ge⌠ askeΣ iµ yo⌡ wan⌠ t∩ d∩ anothe≥ file).
  348.  
  349. Note║ì
  350. A⌠á presen⌠á therσá i≤ n∩ commanΣ linσ optioεá fo≥á PREBA╙á unde≥ ì
  351. MS/DOS«á Thi≤á i≤ becausσ wheε yo⌡ loaΣ ß compileΣ BASI├á prograφ ì
  352. unde≥ MS/DOS¼á b∙ thσ timσ thσ prograφ get≤ control¼á thσ segmen⌠ ì
  353. register≤ havσ changed«á ╔ don'⌠ kno≈ ho≈ ß runninτ BASI├ prograφ ì
  354. woulΣá inquirσ a≤ t∩ wherσ thσ MS/DO╙ (anΣ commanΣ line⌐á segmen⌠ ì
  355. resides«á Iµ anyonσ ha≤ an∙ idea≤ abou⌠ ho≈ thi≤ i≤ done¼á ╔ surσ ì
  356. woulΣ appreciatσ hiφ droppinτ mσ ß linσ anΣ lettinτ mσ iε oεá thσ ì
  357. secret.
  358.  
  359. Thσ synta° fo≥ thσ PREBA╙ commanΣ linσ modσ is║
  360.  
  361. PREBA╙ INFILE[.EXT▌ [OUTFILE[.EXT]▌ [$[{+,-}L▌ [{+,-}N▌ [{+,-}C▌ì
  362. ááááááááááááááááááááááááááááááááááá [Mc▌ [Sxxx▌ [Pxxx]▌
  363.  
  364. Where║
  365.  
  366. [...▌áááá indicate≤ thσ paramete≥ i≤ optional«ì
  367. {...²áááá indicate≤ yo⌡ mus⌠ chosσ onσ oµ thσ option≤ enclosed«ì
  368. xx°áááááá i≤ ß number«ì
  369. πáááááááá i≤ ß character«
  370.  
  371. INFIL┼ááá I≤ thσ sourcefilσ yo⌡ wan⌠ t∩ process« Thi≤ caε bσ 
  372.           precedeΣ b∙ ß drivσ designato≥ (e.g« B:TEST)¼ otherwisσ
  373.           thσ loggeΣ iε (default⌐ drivσ i≤ assumed«
  374.  
  375. OUTFIL┼áá I≤ thσ namσ oµ thσ destinatioε file« Iµ no⌠ specified¼
  376.           i⌠ default≤ t∩ thσ namσ oµ thσ infile¼ thσ drivσ oµ thσ
  377.           infile¼ anΣ aε extensioε oµ ".BASó (e.g« B:TEST.BAS)«
  378.  
  379. EX╘áááááá Optiona∞ filenamσ extension« Iµ no⌠ specified¼ i⌠ 
  380.           default≤ t∩ ".BASó fo≥ thσ OUTFILE¼ anΣ nothinτ 
  381.           ("«áá "⌐ fo≥ thσ infile«
  382.  
  383. èñá        (Optional.⌐á Tell≤á PREBA╙á tha⌠ an∙ numbe≥á oµácommanΣ
  384. á         linσ option≤ follow« EacΦ optioε mus⌠ bσ separateΣ b∙ ß
  385.           space.
  386.  
  387. OPTIONS║
  388.  
  389. +╠ááááááá (Default.⌐ Resolvσ Label≤ iε INFILE¼ anΣ translatσ int∩ ì
  390. ááááááááá absolutσ (linσ number⌐ target≤ iε OUTFILE«
  391.  
  392. -╠ááááááá D∩ no⌠ resolvσ Label≤ iε INFILE«
  393.  
  394. +╬ááááááá (Default.⌐ AdΣ linσ Number≤ t∩ OUTFIL┼
  395.  
  396. -╬ááááááá D∩ no⌠ adΣ linσ Number≤ t∩ OUTFIL┼
  397.  
  398. +├ááááááá (Default.⌐ AdΣ Comment≤ t∩ thσ enΣ oµ line≤ showinτ 
  399.           targe⌠ label≤ ¿ ºáááá TO║ @SUB1¼ @SUB2¼ @ERROR...)«
  400.  
  401. -├ááááááá D∩ no⌠ adΣ Comment≤ t∩ thσ enΣ oµ lines«
  402.  
  403. Sxx°ááááá Se⌠ Star⌠ number« Examplσ -¡ S10░ -¡ wil∞ star⌠ linσ 
  404.           numberinτ witΦ 100« Iµ no⌠ specified¼ thσ defaul⌠ oµ 
  405.           1░ i≤ assumed«
  406.  
  407. Pxx°ááááá Se⌠ ste╨ size« Examplσ -¡ P1╡ -¡ wil∞ numbe≥ line≤ iε ì
  408. ááááááááá increment≤ oµ 15¼ (10,25,40,55...)« Iµ no⌠ specified¼ ì
  409. ááááááááá thσ defaul⌠ oµ 1░ i≤ assumed«
  410.  
  411. Mπááááááá Se⌠ marke≥ character« Examplσ -¡ M¬ -¡ wil∞ searcΦ fo≥ 
  412.           label≤ witΦ "*ó fo≥ thei≥ firs⌠ character« Iµ no⌠ 
  413.           specified¼ thσ defaul⌠ oµ "@ó i≤ assumed«
  414.  
  415. EXAMPLES║
  416.  
  417. A>PREBA╙ B:TES╘ì
  418. Write≤ B:TES╘ t∩ B:TEST.BA╙ witΦ al∞ thσ standarΣ defaults.
  419.  
  420. A>PREBA╙ B:TES╘ $-╬ì
  421. Write≤á B:TES╘ t∩ B:TEST.BA╙ resolvinτ labels¼á bu⌠ doe≤ no⌠á adΣ ì
  422. linσ number≤ (othe≥ thaε thosσ oε line≤ witΦ targe⌠ labels)
  423.  
  424. A>PREBA╙ B:TES╘ ñ -╬ M▐ -├ S▒ P▒ì
  425. Samσ a≤ above¼á bu⌠ doe≤ no⌠ adΣ comments¼á anΣ look≤ fo≥á label≤ ì
  426. markeΣ b∙ "^ó a≤ thei≥ leadinτ character« Becausσ oµ thσ "S▒ P1"¼ ì
  427. line≤á startinτá witΦá targe⌠ label≤ wil∞ bσá numbereΣá witΦá thσ ì
  428. actua∞á numbe≥á oµ line≤ froφ thσ to≡ oµ thσ filσá (no⌠á countinτ ì
  429. sol∩ linefeeds).
  430.  
  431. A>PREBA╙ TEST.BA╙ B:STRIP.OUT$-╠ -╬ì
  432. Strip≤á linσá number≤á froφ TEST.BA╙ oε thσá defaul⌠á drive¼á anΣ ì
  433. write≤ thσ strippeΣ filσ t∩ STRIP.OU╘ oε thσ B║ drive.
  434.  
  435. Thi≤ softwarσ fit≤ int∩ thσ categor∙ oµ what'≤ termeΣ "freeware"« ì
  436. (AlthougΦá ßá bette≥ descriptioε woulΣ bσá "almos⌠á freewareóá o≥ ì
  437. "somewha⌠ freeware")«á Wha⌠ tha⌠ mean≤ is¼á iµ yo⌡ likσ it¼á theε ìèpa∙ fo≥ it« 
  438.  
  439. Iµá yo⌡á havσá founΣá thi≤ softwarσ useful¼á anΣ iµá yo⌡á havσá ß ì
  440. consciencσ anΣ arσ no⌠ poo≥ -- theε thσ autho≥ woulΣ likσ yo⌡á t∩ ì
  441. sho≈á you≥ appreciatioε b∙ sendinτ hiφ somσ buck≤ fo≥ it«á Eveε ß ì
  442. smal∞ amount¼á eveε ß dollar¼á woulΣ bσ warml∙ received« Thinδ oµ ì
  443. wha⌠ i⌠ woulΣ havσ cos⌠ yo⌡ iε timσ t∩ writσ i⌠ fo≥ yourself«á Iµ ì
  444. yo⌡á senΣ $1░ dollar≤ o≥ over¼á yo⌡ wil∞ bσ placeΣ oε m∙á mailinτ ì
  445. lis⌠ t∩ ge⌠ thσ lates⌠ updatσ oµ thσ prograφ (a⌠ n∩ charge)¼á anΣ ì
  446. perhap≤á somσá othe≥ goodie≤ ╔ migh⌠ havσ lyinτá arounΣá a⌠á tha⌠ ì
  447. time.
  448.  
  449. ááááááááááááááááááá G« Wolfσì
  450. ááááááááááááááááááá 8╕ 51s⌠ Avenue¼ NortΦì
  451. ááááááááááááááááááá Boi≤ dσ Filion≤ì
  452. ááááááááááááááááááá Quebec¼ Canada¼á J6┌ 2N╣
  453.  
  454. Thi≤á i≤á ßá prograφ tha⌠ run≤ MUC╚ bette≥á wheεá compileΣá (eveε ì
  455. disregardinτá m∙á freσ usσ oµ comments¼á whitσ space¼á anΣá largσ ì
  456. variablσá names.⌐á Thσá versioε oε thσ P─ librar∙á i≤á linkeΣá t∩ ì
  457. OBSLIB.RE╠á s∩á i⌠ caε bσ useΣ b∙ anyone«á Iµ yo⌡ kee≡ ßá se⌠á oµ ì
  458. utilitie≤ oε ß disδ witΦ BRUN.REL¼ yo⌡ caε recompilσ t∩ linδ witΦ ì
  459. tha⌠ librar∙ (n∩ /╧ option)¼á anΣ you'l∞ savσ yourselµ abou⌠á 20╦ ì
  460. oµ disδ space«á Thσ tw∩ version≤ ruε thσ same¼ witΦ thσ exceptioε ì
  461. tha⌠ thσ BRU╬ versioε take≤ abou⌠ ▓ second≤ morσ t∩ load.
  462.  
  463. OPTIO╬ DEFAULT╙ì
  464. ==============╜
  465.  
  466. Al∞á thσ optioε default≤ arσ gathereΣ nea≥ thσ fron⌠ end¼á s∩ arσ ì
  467. eas∙ t∩ change« Herσ i≤ ß list:
  468.  
  469. 17░ MSDO╙ ╜ FALS┼ ºááá Se⌠ truσ iµ yo⌡ intenΣ t∩ por⌠ t∩ ß MS/DO╙ ì
  470. áááááááááááááááááááááá machine¼ bu⌠ reaΣ belo≈ abou⌠ portinτ t∩ ì
  471. áááááááááááááááááááááá MS/DO╙ì
  472. 18░ OSEXE├ ╜ TRU┼ ºááá Truσ iµ we'rσ oε aε Osbornσ Exec«ì
  473. áááááááááááááááááááááá (O≥ aε Osbornσ 1)¼ o≥ othe≥ CP═ machinσì
  474. 20░ I╞ OSEXE├ ╜ TRU┼ THE╬ CLSñ ╜ CHR$(26⌐ºThσ clea≥ screeε string¼ ì
  475. ááááááááááááááááááááááááááááááááááááááááááfo≥ you≥ machinσ (CPM⌐ì
  476. 21░ MARKERñ ╜ "@ó ºáááááááááááááááááááádefaul⌠ labe∞ identifie≥ì
  477. 23░ DI═ LABTAB$(2,1000⌐ºThσ seconΣ number¼ iε parenthesis¼ i≤ thσ ì
  478. ááááááááááááááááááááááánumbe≥ oµ label≤ wσ caε handlσ a⌠ once« Bσ ì
  479. ááááááááááááááááááááááácarefu∞ oµ RA═ iµ yo⌡ bum≡ thi≤ up«ì
  480. 25░ STARTNU═ ╜ 10║ STEPSIZ┼ ╜ 1░' Defaul⌠ values«ì
  481. 26░ ADDVECT╙ ╜ TRU┼ ºááááSho≈ thσ replaceΣ label≤ a≤ comment≤ a⌠ ì
  482. áááááááááááááááááááááááááthσ enΣ oµ thσ line« Default«ì
  483. 28░ COMBU╞ ╜ &H8░ ºááááááCP═ commanΣ linσ buffe≥ì
  484. 30░ INFEXTñ ╜ ""║ OUTFEXTñ ╜ ".BASóºDefaul⌠ filσ extension≤ fo≥ ì
  485. ááááááááááááááááááááááááááááááááááááINFIL┼ anΣ OUTFIL┼ (remembe≥ ì
  486. ááááááááááááááááááááááááááááááááááááthσ leadinτ period)«ì
  487. 34░ DOLABEL╙ ╜ TRUE║ DOLINUM╙ ╜ TRU┼ºDefault≤ oµ whethe≥ wσ 
  488.                                 resolvσ label≤ anΣ whethe≥ wσ adΣ 
  489.                                 linσ numbers«
  490.  
  491.  
  492. èPortinτ t∩ MS/DOS║ì
  493. Se⌠ MSDO╙ t∩ TRU┼ iε linσ 170¼á anΣ OSEXE├ t∩ FALS┼ iε linσá 180« ì
  494. Yo⌡ wil∞ havσ t∩ changσ thσ @CLEARSCREE╬ routinσ t∩ "CLS║ RETURNó ì
  495. o≥á se⌠á thσ CLSñ iε linσ 20░ t∩ whateve≥ you≥ clea≥á screeεá anΣ ì
  496. homσá strinτá is«á Also¼á ╔ aφ ver∙ libera∞ iε extendinτá logica∞ ì
  497. line≤á int∩á ß numbe≥ oµ physica∞ lines¼á b∙ thσá usσá oµá singlσ ì
  498. linefeed≤ (n∩ CR)«á Then¼ whilσ ╔ aφ debugginτ anΣ saving¼ MBASI├ ì
  499. take≤á thosσá anΣá save≤ theφ ou⌠ a≤ linefeeΣá - carriagσá returε ì
  500. pair≤ (rathe≥ thaε thσ CR-L╞ pair≤ a⌠ thσ enΣ oµ regula≥á lines)« ì
  501. Iεá MS/DOS¼á neithe≥á thσ interprete≥ o≥ thσ compile≥á recognize≤ ì
  502. thesσá a≤á logica∞á linσá extender≤á (thσá intrigue≤á oµáá MS/DO╙ ì
  503. software¼ I'l∞ neve≥ understand.⌐ Yo⌡ wil∞ havσ t∩ finΣ thesσ anΣ ì
  504. takσá theφá ou⌠ witΦ you≥ editor¼á makinτ somσ ver∙á lonτá lines« ì
  505. (The∙á wil∞ sho≈ u≡ iε WordSta≥ a≤ ß "Jó theε ß "-ó oε thσá righ⌠ ì
  506. margin« SearcΦ anΣ replacσ fo≥ ^P^J^P<RET>« Bu⌠ perhap≤ bette≥ t∩ ì
  507. searcΦ fo≥ thσ ^P<RET>^I≤ first¼á replacinτ witΦ ^P<RET╛ <SPACE>« ì
  508. D∩ thi≤ unti∞ you'vσ go⌠ al∞ thσ tab≤ ou⌠ first¼á theε ge⌠ riΣ oµ ì
  509. thσ LF-CRs« Elsσ you'l∞ havσ ß hel∞ oµ ß joΓ gettinτ theφ out« 
  510.  
  511.  
  512. ááááááááááááááááááááá APPENDI╪ ┬ -¡ Aε examplσ ruεì
  513. ááááááááááááááááááááá ===========================╜
  514.  
  515. Herσ i≤ aε examplσ sourcσ program║
  516.  
  517. º THI╙ I╙ ┴ TES╘ FO╥ PREBA╙ì
  518. ºì
  519. @STARԍ
  520. ┐ "W┼ AR┼ UNDE╥ @STARTóì
  521. O╬ ERRO╥ GOT╧ @ERRO╥ì
  522. GOT╧ @NEX╘ì
  523. STOЍ
  524. @Nex⌠ -¡ ┴ lowe≥ (mixed⌐ casσ target«ì
  525. ┐ "WE'R┼ A╘ @NEXTóì
  526. FO╥ ╔ ╜ ▒ T╧ 30░ì
  527. ááááááá ┐ "THES┼ TW╧ LINE╙ HAV┼ LINEFEEDS"║ì
  528. ááááááááááááááááá GOSU┬ @FINDX║ì
  529. ááááááááááááááááá GOSU┬ @FIND╪ì
  530. ááááááá I╞ Añ <╛ "ó THE╬ GOT╧ @LASTFO╥ì
  531. ááááááá @LastFO╥ -¡ ┴ tabbeΣ labe∞ witΦ mixeΣ case«ì
  532. NEX╘ ╔ì
  533. I╞ Añ <╛ "Xó AN─ Añ <╛ "xó THE╬ GOT╧ @STAR╘ ELS┼ GOT╧ @EN─ì
  534. ºì
  535. @ERROҍ
  536. ┐ "W┼ HA─ A╬ ERRORóì
  537. RESUM┼ @NEX╘ ºá I⌠ work≤ fo≥ RESUM┼ (oµ course⌐ì
  538. ºì
  539. @FIND؍
  540. ┐ "W┼ AR┼ I╬ @FINDXóì
  541. Añ ╜ INKEYñì
  542. RETUR΍
  543. ºì
  544. ºáááááá Note║ therσ i≤ n∩ conflic⌠ betweeε @EN─ anΣ EN─ì
  545. @EN─ì
  546. EN─
  547. è
  548. Thσ outpu⌠ (PREBASed⌐ prograφ i≤ showε oε thσ nex⌠ page.
  549.  
  550. 1░ º THI╙ I╙ ┴ TES╘ FO╥ PREBA╙ì
  551. 2░ ºì
  552. 3░ '@STAR╘ì
  553. 4░ ┐ "W┼ AR┼ UNDE╥ @STARTóì
  554. 5░ O╬ ERRO╥ GOT╧ 17░ ºá TO║ @ERRO╥ì
  555. 6░ GOT╧ 8░ ºááá TO║ @NEX╘ì
  556. 7░ STO╨ì
  557. 8░ '@Nex⌠ -¡ ┴ lowe≥ (mixed⌐ casσ target«ì
  558. 9░ ┐ "WE'R┼ A╘ @NEXTóì
  559. 10░ FO╥ ╔ ╜ ▒ T╧ 30░ì
  560. 11░áááá ┐ "THES┼ TW╧ LINE╙ HAV┼ LINEFEEDS"║ì
  561. áááááááááááá GOSU┬ 210║ì
  562. áááááááááááá GOSU┬ 21░ ºááááááá TO║ @FINDX¼ @FIND╪ì
  563. 12░áááá I╞ Añ <╛ "ó THE╬ GOT╧ 13░ ºáááá TO║ @LASTFO╥ì
  564. 13░ ºáá @LastFO╥ -¡ ┴ tabbeΣ labe∞ witΦ mixeΣ case«ì
  565. 14░ NEX╘ ╔ì
  566. 15░á I╞ Añ <╛ "Xó AN─ Añ <╛ "xó THE╬ GOT╧ 3░ ELS┼ GOT╧ 27░ ºá TO║ ì
  567. @START¼ @EN─ 
  568. 16░ º 
  569. 17░ '@ERRO╥ 
  570. 18░ ┐ "W┼ HA─ A╬ ERRORó 
  571. 19░ RESUM┼ 8░á ºá I⌠á work≤ fo≥ RESUM┼ (oµ course⌐ º TO║á @NEX╘á 
  572. 20░á ºá 
  573. 21░ '@FIND╪ 
  574. 22░ ┐ "W┼ AR┼ I╬ @FINDXó 
  575. 23░ Añ ╜ INKEYñ 
  576. 24░ RETUR╬ 
  577. 25░ º ì
  578. 26░á º Note║á therσ i≤ n∩ conflic⌠ betweeε @EN─ anΣ EN─ 
  579. 27░ '@EN─ ì
  580. 28░ END
  581.  
  582.  
  583. Notσá ho≈á wσá handlσá mixeΣá casσá labels¼á tabbeΣá labels¼á anΣ ì
  584. linefeed≤ (oε linσ 110).
  585.  
  586.  
  587. áááááááááááááááááááááááááááááááááááá @EN─
  588.