home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1986 February / 64er_Magazin_86-02_1986_Markt__Technik_de.d64 / text-transposer (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  151 lines

  1. 60000 rem *****************************
  2. 60010 rem **     text-transposer     **
  3. 60020 rem **(vizawrite/startexter/sm)**
  4. 60030 rem **   m.schacht (c) 1985    **
  5. 60040 rem *****************************
  6. 60050 :
  7. 60060 printchr$(147):poke788,52:rem run/stop blockieren
  8. 60070 an=32:en=78:rem lb/hb basic-ende=anfang textspeicher
  9. 60080 zs=20000:ta=50000:rem adressen zwischenspeicher/tabelle
  10. 60090 poke53280,0:poke53281,0
  11. 60100 fori=1to38:bl$=bl$+chr$(32):bs$=bs$+chr$(163):next
  12. 60110 gosub61220:gosub61300:rem datas einlesen
  13. 60120 poke250,80:poke251,195:sys927:rem tabelle vorbelegen
  14. 60130 :
  15. 60140 rem ---------------menue/abfragen
  16. 60150 po=4:az=18:gosub60690:printchr$(159)chr$(14)chr$(8):poke214,1:print
  17. 60160 printchr$(18)left$(bl$,14);"[212]ext-[197]ditor";left$(bl$,13):printbl$:printbs$
  18. 60170 poke214,22:print:printchr$(18)left$(bl$,13);"mit _ zurueck";left$(bl$,12)
  19. 60180 poke214,8:print:fori=0to1:printme$(i):print:next
  20. 60190 poke198,0:wait198,1:getx$:ifx$="_"thenprintchr$(147):poke788,49:end
  21. 60200 ifasc(x$)<65orasc(x$)>66then60190
  22. 60210 poke214,2:print:printtab(2)right$(me$(asc(x$)-65),34)
  23. 60220 on(asc(x$)-64)gosub60420,60510
  24. 60230 po=4:az=18:gosub60690:goto60150
  25. 60240 :
  26. 60250 rem ---------------file editieren
  27. 60260 poke214,20:print:printchr$(18)"einzeln oder komplett editieren (e/k)?"
  28. 60270 poke198,0:wait198,1:getx$:ifx$<>"e"andx$<>"k"andx$<>"_"then60270
  29. 60280 ifx$="_"then run 60070
  30. 60290 poke788,49:poke49155,0:ifx$="e"thenpoke49155,1:rem flag
  31. 60300 :
  32. 60310 rem......schleife anfang.........
  33. 60320 printchr$(147):poke214,0:sys58640
  34. 60330 sys864:rem codewandlung und print
  35. 60340 an=peek(5)+peek(250)+1:en=peek(251):ifan>255thenan=an-256:en=en+1
  36. 60350 poke250,an:poke251,en:rem neue anfangsadresse
  37. 60360 poke631,19:poke632,13:poke633,13:poke634,13:poke198,4:ifpeek(49155)=1thenpoke198,2
  38. 60370 ifpeek(214)>2andpeek(1104)<>32thenpoke198,2:poke214,3:poke211,0:print:print"kuerzen!?"
  39. 60380 printchr$(18)"run 60320":end
  40. 60390 rem.....schleife ende............
  41. 60400 :
  42. 60410 rem --------------(a)-prg => text
  43. 60420 po=8:az=3:gosub60690:poke214,4:print
  44. 60430 printtab(4)chr$(28)me$(5):printme$(6)chr$(34)me$(7)chr$(34);me$(8)
  45. 60440 printme$(9)chr$(159):printbs$
  46. 60450 poke214,6:print:gosub60580:ift$="_"thenreturn
  47. 60460 gosub61080:rw$="r":ad=828:gosub61140:ifn$="_"thenreturn
  48. 60470 poke214,19:print:onval(t$)gosub60720,60840,60950
  49. 60480 rw$="w":ad=885:gosub61140:run 60070
  50. 60490 :
  51. 60500 rem --------------(b)-text => prg
  52. 60510 po=8:az=3:gosub60690
  53. 60520 gosub60580:ift$="_"thenreturn
  54. 60530 poke214,19:print:onval(t$)gosub60770,60890,61020
  55. 60540 rw$="r":poke936,96:ad=828:gosub61140:poke936,234:ifn$="_"thenreturn
  56. 60550 goto60260:rem editieren
  57. 60560 :
  58. 60570 rem-----------------------auswahl
  59. 60580 poke214,8:print:fori=2to4:print:printtab(12)me$(i):next
  60. 60590 poke198,0:wait198,1:gett$:ift$="_"thenreturn
  61. 60600 ifasc(t$)<49orasc(t$)>51 then60590
  62. 60610 poke214,val(t$)*2+7:print:printtab(12)chr$(18)me$(val(t$)+1):return
  63. 60620 :
  64. 60630 rem -----------------------fehler
  65. 60640 input#15,fe,fe$:iffe=0thenreturn
  66. 60650 poke214,20:print:printtab(19)chr$(28)left$(fe$+bl$,19)chr$(159)
  67. 60660 fori=0to2000:next:po=19:az=3:gosub60690:poke214,po:print:return
  68. 60670 :
  69. 60680 rem ---------teilbereich loeschen
  70. 60690 poke214,po:print:forq=1toaz:printbl$:next:return
  71. 60700 :
  72. 60710 rem -----------(a)-parameter-viza
  73. 60720 f$="s":an=32:en=78
  74. 60730 poketa+34,191
  75. 60740 return
  76. 60750 :
  77. 60760 rem -----------(b)-parameter-viza
  78. 60770 f$="p":poke985,96:rem prg-file/flag
  79. 60780 fori=0to31:poketa+i,i+64:poketa+65+i,i+97:next
  80. 60790 poketa+220,13:poketa+127,34
  81. 60800 poke250,an+23:poke251,en+1:rem bytes ueberlesen
  82. 60810 return
  83. 60820 :
  84. 60830 rem -----------(a)-parameter-star
  85. 60840 f$="p":an=184:en=78
  86. 60850 poketa+95,163:poketa+13,95
  87. 60860 return
  88. 60870 :
  89. 60880 rem -----------(b)-parameter-star
  90. 60890 f$="p":poke985,234
  91. 60900 poketa+95,13:poketa+163,95
  92. 60910 poke250,an+2:poke251,en:rem bytes ueberlesen
  93. 60920 return
  94. 60930 :
  95. 60940 rem -----------(a)-parameter---sm
  96. 60950 f$="s":an=15:en=78
  97. 60960 nn$=">.............000"
  98. 60970 fori=1to17:pokezs-18+i,asc(mid$(nn$,i,1)):next
  99. 60980 poketa+34,191
  100. 60990 return
  101. 61000 :
  102. 61010 rem -----------(b)-parameter---sm
  103. 61020 f$="s":poke985,96:rem seq-file/flag
  104. 61030 poketa+191,34
  105. 61040 poke250,an+19:poke251,en:rem bytes ueberlesen
  106. 61050 return
  107. 61060 :
  108. 61070 rem --------(a)-all.parameter-prg
  109. 61080 f$="p":an=32:en=78
  110. 61090 ift$="1"ort$="3"thenpoke936,96
  111. 61100 ift$="2"thenpoke936,234
  112. 61110 return
  113. 61120 :
  114. 61130 rem ---------file lesen/schreiben
  115. 61140 w$="<load> ":ifrw$="w"thenw$="<save> "
  116. 61150 poke214,19:print:print:printw$;:input"file-name:";n$:ifn$="_"thenreturn
  117. 61160 open15,8,15:open2,8,2,"@:"+n$+","+f$+","+rw$:gosub60640
  118. 61170 iffe<>0thenclose2:close15:goto61140
  119. 61180 poke3,an:poke4,en:sys ad:poke214,21:print:printbs$
  120. 61190 close2:close15:return
  121. 61200 :
  122. 61210 rem ------------------datas menue
  123. 61220 fori=0to9:readme$(i):next:return
  124. 61230 data "(a) prg-file  in  textprg-file wandeln"
  125. 61240 data "(b) textprg-file in basic-file wandeln"
  126. 61250 data "(1) [214]izawrite ","(2) [211]tar[212]exter ","(3) [211][205] - [212]ext "
  127. 61260 data "prg-file zuvor abspeichern mit","open8,8,8,","name,p,w"
  128. 61270 data ":cmd8:list:print#8","close8"
  129. 61280 :
  130. 61290 rem ------datas maschinenroutinen
  131. 61300 ifpeek(828)=162thenreturn:rem bereits eingelesen
  132. 61310 fori=0to170:readdt:poke828+i,dt:next:return
  133. 61320 data162,2,32,198,255,160,0,32,207,255,32,168,3,145,3,230,3,208,2,230,4
  134. 61330 data36,144,80,238,165,3,133,5,165,4,133,6,76,204,255,160,0,177,250,170
  135. 61340 data189,80,195,32,210,255,201,13,240,106,200,132,5,208,238,96,162,2,32
  136. 61350 data201,255,198,1,160,0,56,165,3,229,5,165,4,229,6,176,17,177,3,170,189
  137. 61360 data80,195,32,210,255,230,3,208,232,230,4,208,228,230,1,76,204,255,160
  138. 61370 data0,152,145,250,200,208,250,96,234,232,201,13,240,1,96,145,3,224,82,240
  139. 61380 data13,176,16,169,32,232,230,3,208,241,230,4,208,237,162,2,96,145,3,224
  140. 61390 data162,240,11,169,32,232,230,3,208,243,230,4,208,239,162,2,96,96,200,177
  141. 61400 data250,201,32,240,1,96,132,5,76,218,3
  142. 61410 :
  143. 61490 rem -----------------prg loeschen
  144. 61500 printchr$(147);tab(7)"[212]ext-[197]ditor loeschen (j/n)?":poke198,0:wait198,1:getx$
  145. 61510 ifx$<>"j"andx$<>"n"then61500
  146. 61520 ifx$="n"thenrun60060
  147. 61530 poke49152,0
  148. 61540 printchr$(147);:fori=peek(49152)topeek(49152)+7:print(i+6000)*10:next
  149. 61550 print"goto61540":poke49152,peek(49152)+8
  150. 61560 poke631,19:fori=632to640:pokei,13:next:poke198,10
  151.