home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MISC / SPE.ZIP / PRINT.BAS < prev    next >
Encoding:
BASIC Source File  |  1987-06-14  |  5.3 KB  |  191 lines

  1. 00005  REM Basic Program                            :  print
  2. 00007  REM                 created                  :  9.3.86
  3. 00009  REM                 from                     :  Volker Sasse
  4. 00011  REM Structogram     saved on disk            :  Basic-Sicher
  5. 00013  REM                 filename                 :  print.spe
  6. 00015  REM Basic text      saved on disk            :  Basic-Sicher
  7. 00017  REM                 filename                 :  print.bas
  8. 00019  REM
  9. 00021  REM This program prints structograms in the way you see them on the screen.
  10. 00023  REM This program needs the font <<print.fon>> as datafile.
  11. 00025  REM In order to print a structogram make a printfile on a disk with the command print.
  12. 00027  REM
  13. 00029  REM You can print a few structograms in one session while you make a walk.
  14. 00031  REM
  15. 00033  REM You need a dot matrix printer which is compatible to the Epson MX80.
  16. 00035  REM The program uses the dual-density bit image mode 960 dots per line.
  17. 00037  REM If the program does not work reference your printer manual and change the controlcodes.
  18. 00039  REM
  19. 00045  REM
  20. 00047  REM Vereinbarungen
  21. 00049  REM
  22. 00051  REM Druckmatrix : Höhe = 10 Punkte, Breite =  8 Punkte
  23. 00053      Hoehe  = 10
  24. 00055      Breite =  8
  25. 00057  DIM High$(255), Low$(255)
  26. 00059      Verschiebung1 =  5
  27. 00061      Verschiebung2 =  5
  28. 00063      Zeichensatz$ = ""
  29. 00065      Punktbreite = 4
  30. 00067      Punkthoehe  = 2
  31. 00073  COLOR 7,0 
  32. 00075  CLS
  33. 00077  PRINT "Program for printing SPE structograms"
  34. 00079  Zeichensatz$="print.fon"
  35. 00081  PRINT "How many times shall I go over a line (number)";
  36. 00083  INPUT Doppel
  37. 00085  Struktogramm$=""
  38. 00087  DIM Strukto$(50)
  39. 00089  Stzaehler=0
  40. 00091  PRINT "Press RETURN if list is complete!"
  41. 00097 rem 
  42. 00109  INPUT "Which structogram shall be printed "; Struktogramm$
  43. 00111   IF Struktogramm$="" goto 00115 else goto 00121 
  44. 00115 rem 
  45. 00117  goto 00130
  46. 00120  goto 00127
  47. 00121 rem 
  48. 00123  Strukto$(Stzaehler)=Struktogramm$
  49. 00125  Stzaehler=Stzaehler + 1
  50. 00127 rem 
  51. 00129  goto 00097
  52. 00130 rem 
  53. 00137  PRINT "Filenames correct, continue program (y) ";
  54. 00139  INPUT Entscheidung$
  55. 00141   IF Entscheidung$<>"y" goto 00145 else goto 00151 
  56. 00145 rem 
  57. 00150  goto 00183
  58. 00151 rem 
  59. 00155 gosub 00195
  60. 00163   FOR St=0 to Stzaehler-1 
  61. 00173  Struktogramm$=Strukto$(St)
  62. 00175  PRINT "Printing : "; Struktogramm$
  63. 00177 gosub 00481
  64. 00179 next
  65. 00180 rem 
  66. 00183 rem 
  67. 00189  END
  68. 00194  end
  69. 00195 rem 
  70. 00197 rem  Satzladen
  71. 00209  PRINT "Loading  : "; Zeichensatz$
  72. 00211  OPEN Zeichensatz$ FOR INPUT AS #2
  73. 00219   FOR T=0 TO 255
  74. 00231   High$(T)="" : Low$(T)=""
  75. 00239   FOR Q=1 TO Breite
  76. 00249  INPUT #2, High% : High$(T)=High$(T) + CHR$(High%)
  77. 00251  INPUT #2, Low%  : Low$(T) =Low$(T)  + CHR$(Low%)
  78. 00253 next
  79. 00254 rem 
  80. 00257 next
  81. 00258 rem 
  82. 00263  CLOSE #2
  83. 00271 return
  84. 00276  end
  85. 00277 rem 
  86. 00279 rem  PrLine
  87. 00293  Anzahl=LEN(B$) * Breite
  88. 00295  High=INT(Anzahl / 256) : Low=Anzahl - High * 256
  89. 00297  PRINT #1, CHR$(27);"A";CHR$(Verschiebung1);CHR$(27);CHR$(2); 
  90. 00305   FOR F=1 TO Doppel
  91. 00317  PRINT #1, CHR$(13);CHR$(27);"L";CHR$(Low);CHR$(High);
  92. 00325   FOR T=1 TO LEN(B$)
  93. 00335   PRINT #1, High$(ASC(MID$(B$, T, 1)));
  94. 00337 next
  95. 00338 rem 
  96. 00341 next
  97. 00342 rem 
  98. 00347  PRINT #1, CHR$(10);
  99. 00355   FOR F=1 TO Doppel
  100. 00367  PRINT #1, CHR$(13);CHR$(27);"L";CHR$(Low);CHR$(High);
  101. 00375   FOR T=1 TO LEN(B$)
  102. 00385   PRINT #1, Low$(ASC(MID$(B$, T, 1)));
  103. 00387 next
  104. 00388 rem 
  105. 00391 next
  106. 00392 rem 
  107. 00401 return
  108. 00406  end
  109. 00407 rem 
  110. 00409 rem  SuLine 
  111. 00421  Anzahl=LEN(B$) * Breite
  112. 00423  High=INT(Anzahl / 256) : Low=Anzahl - High * 256
  113. 00431   FOR F=1 TO Doppel
  114. 00443  PRINT #1, CHR$(13);CHR$(27);"L";CHR$(Low);CHR$(High);
  115. 00451   FOR T=1 TO LEN(B$)
  116. 00461   PRINT #1, Low$(ASC(MID$(B$, T, 1)));
  117. 00463 next
  118. 00464 rem 
  119. 00467 next
  120. 00468 rem 
  121. 00475 return
  122. 00480  end
  123. 00481 rem 
  124. 00483 rem  Struktogramm
  125. 00495  OPEN "LPT1" FOR OUTPUT AS #1
  126. 00497  OPEN Struktogramm$  FOR  INPUT AS #2
  127. 00499  B$="" : ZH=0 : ME=0
  128. 00507   FOR T=1 TO 2
  129. 00517 rem 
  130. 00529  A$=INPUT$(1, #2)
  131. 00537   IF A$=CHR$(13) goto 00541 else goto 00547 
  132. 00541 rem 
  133. 00543  goto 00554
  134. 00547 rem 
  135. 00549 rem 
  136. 00553  goto 00517
  137. 00554 rem 
  138. 00555 next
  139. 00556 rem 
  140. 00563 rem 
  141. 00575   IF EOF(2) goto 00579 else goto 00597 
  142. 00579 rem 
  143. 00581  PRINT #1,CHR$(27);"A";CHR$(12);
  144. 00583  PRINT #1,CHR$(27);CHR$(2); 
  145. 00585  PRINT #1,CHR$(13)
  146. 00587  PRINT #1,CHR$(27);CHR$(64);
  147. 00589  CLOSE #2
  148. 00591  CLOSE #1
  149. 00593  goto 00732
  150. 00596  goto 00729
  151. 00597 rem 
  152. 00601  A$=INPUT$(1, #2)
  153. 00613 rem 
  154. 00617   IF A$=         CHR$(13) goto 00621 else goto 00661 
  155. 00621 rem 
  156. 00627   IF B$="" goto 00631 else goto 00637 
  157. 00631 rem 
  158. 00633  ME=0
  159. 00636  goto 00653
  160. 00637 rem 
  161. 00641 gosub 00277
  162. 00647  B$=""
  163. 00649  ME=1
  164. 00653 rem 
  165. 00657  goto 00725
  166. 00661 rem 
  167. 00665   IF A$=     CHR$(10)  goto 00669 else goto 00705 
  168. 00669 rem 
  169. 00675   IF ME=1  goto 00679 else goto 00685 
  170. 00679 rem 
  171. 00681 gosub 00407
  172. 00684  goto 00689
  173. 00685 rem 
  174. 00687 gosub 00277
  175. 00689 rem 
  176. 00695  PRINT #1,CHR$(13);CHR$(10);
  177. 00697  B$=""
  178. 00701  goto 00725
  179. 00705 rem 
  180. 00709   IF A$=    CHR$(12)  goto 00713 else goto 00721 
  181. 00713 rem 
  182. 00715  PRINT #1,CHR$(12);
  183. 00717  goto 00725
  184. 00721 rem 
  185. 00723 B$=B$+A$
  186. 00725 rem 
  187. 00729 rem 
  188. 00731  goto 00563
  189. 00732 rem 
  190. 00741 return
  191.