home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 57 / 64er_Magazin_Sonderheft_57_19xx_Markt__Technik_de_Side_A.d64 / directory-sorter (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  122 lines

  1. 100 rem ************************
  2. 110 rem *                      *
  3. 120 rem * directory-sort v1.0  *
  4. 130 rem * -------------------  *
  5. 140 rem * autor:               *
  6. 150 rem * edwin goebel         *
  7. 160 rem * schuetzstr. 1        *
  8. 170 rem * 8522 herzogenaurach  *
  9. 180 rem *                      *
  10. 190 rem ************************
  11. 200 goto430
  12. 210 rem *******************************
  13. 220 rem  unterroutinen
  14. 230 rem *******************************
  15. 240 input#1,f1,f$,f2,f3:iff1=0thenreturn
  16. 250 print"[159]"f1;f$,f2;f3"[144]":end:rem "[159]"=cyan; "[144]"=schwarz
  17. 260 rem -------------------------------
  18. 270 ifno+en>=cthenreturn
  19. 280 sys53056,0,2,2,23,18:no=no+1
  20. 290 poke214,23:poke211,2:sys58732:printna$(zu(no+en-1));:return
  21. 300 rem -------------------------------
  22. 310 ifno=0thenreturn
  23. 320 sys53056,1,2,2,23,18:no=no-1
  24. 330 poke214,2:poke211,2:sys58732:printna$(zu(no+1)):return
  25. 340 rem -------------------------------
  26. 350 print"[147][144]"tab(13)"directory-sort"
  27. 360 printtab(12)"----------------"
  28. 370 print"[159] diskette einlegen und taste druecken"
  29. 380 gett$:ift$=""then380
  30. 390 print"                                     ":return
  31. 400 rem *******************************
  32. 410 rem  beginn des hauptprogrammes
  33. 420 rem *******************************
  34. 430 poke53280,0:poke53281,11:gosub350
  35. 440 open1,8,15,"i":diman$(145),na$(145),re$(145),zu(146),sn(19)
  36. 450 fori=1to18:readsn(i):next
  37. 460 fori=52992to53242:reads:pokei,s:next
  38. 470 gosub240:open2,8,2,"#":gosub240
  39. 480 s=1:c=1:n$=chr$(0):nn$=n$+n$+n$+n$+n$+n$+n$+n$+n$+n$
  40. 490 nu$=nn$+nn$+nn$:re$(0)=nn$+n$
  41. 500 an$(0)=chr$(128)+chr$(18)+chr$(1):na$(0)="----------------":rem trennstrich
  42. 510 rem *******************************
  43. 520 rem  einlesen des directorys
  44. 530 rem *******************************
  45. 540 print#1,"u1 2 0 18"s:print"[150]"s"[157] ":rem "[150]"=hellrot
  46. 550 get#2,t$:get#2,s$:s=asc(s$+n$)
  47. 560 forbp=0to7:print#1,"b-p 2";bp*32+2
  48. 570 sys52992,2,3,x$:an$(c)=x$:ifleft$(x$,1)=n$thennext:goto600
  49. 580 sys52992,2,16,x$:na$(c)=x$:sys52992,2,11,x$:re$(c)=x$
  50. 590 zu(c)=c:print""c"[157] ":c=c+1:next
  51. 600 ift$<>""then540
  52. 610 close2:poke650,128:print"[144]>[159][145]";:cp=2:no=0:nu=0:en=c:ifen>23thenen=23
  53. 620 printchr$(13)tab(2)na$(nu+1);:nu=nu+1:ifnu<en-1then620
  54. 630 rem *******************************
  55. 640 rem  tastaturabfrage
  56. 690 rem *******************************
  57. 700 getta$:ifta$=""then700
  58. 710 ifta$="[134]"thenifcp>2thencp=cp-1:sys53056,0,2,0,23,0
  59. 720 ifta$="[134]"thenifcp=2thengosub310
  60. 730 ifta$="[135]"thenifcp<enthenifno+cp<cthencp=cp+1:sys53056,1,2,0,23,0
  61. 740 ifta$="[135]"thenifcp>=23thengosub270
  62. 750 ifta$="[133]"then810
  63. 760 ifta$="[137]"thenifc<145thenf=1:c=c+1:print"[150]"c-1"[157] [159]":en=en+1:ifen>23thenen=23
  64. 770 ifta$="[137]"theniff=1thenf=0:te=0:te$=na$(0):goto840
  65. 780 ifta$="[140]"then1000
  66. 790 ifta$="[139]"then1090
  67. 800 goto700
  68. 810 te=zu(no+cp-1):te$=na$(te)
  69. 820 sys53056,0,cp,2,23,18:ifc>23thenen=en+1:gosub290:en=en-1
  70. 830 fori=no+cp-2toc-1:zu(i+1)=zu(i+2):next
  71. 840 poke214,cp:poke211,19:sys58732
  72. 850 print"[163][163]"te$:rem "[163]"=commodore+"t"
  73. 860 getta$:ifta$=""then860
  74. 870 ifta$="[134]"thenifcp>2thencp=cp-1:sys53056,0,2,19,24,37:sys53056,0,2,0,23,0
  75. 880 ifta$="[134]"thenifcp=2thengosub310
  76. 890 ifta$="[135]"thenifcp<enthencp=cp+1:sys53056,1,2,19,24,37:sys53056,1,2,0,23,0
  77. 900 ifta$="[135]"thenifcp=23thengosub270
  78. 910 ifta$="[133]"then950
  79. 920 ifta$="[138]"thente$="":c=c-1:en=c:ifen>23thenen=23
  80. 930 ifta$="[138]"thenprint"[150]"c-1"[157] [159]":goto970
  81. 940 goto860
  82. 950 sys53056,1,cp,2,23,18
  83. 960 fori=c-1tono+cp-1step-1:zu(i+1)=zu(i):next:zu(no+cp-1)=te
  84. 970 poke214,cp:poke211,2:sys58732
  85. 980 printte$"                   "
  86. 990 goto700
  87. 1000 rem ******************************
  88. 1010 rem  schreiben des sortierten dir.
  89. 1020 rem ******************************
  90. 1030 open2,8,2,"#":t=18:fori=0toint((c-2)/8):if8*i+8>=c-1thent=0
  91. 1040 print#1,"b-p 2 0":print#2,chr$(t)chr$(sn(i+2))
  92. 1050 forbp=0to7:print#1,"b-p 2";bp*32+2
  93. 1060 ifbp+8*i+1>=cthenprint#2,nu$;:next:goto1080
  94. 1070 print#2,an$(zu(bp+8*i+1))na$(zu(bp+8*i+1))re$(zu(bp+8*i+1));:next
  95. 1080 print#1,"u2 2 0 18"sn(i+1):print"[150]"tab(36)sn(i+1)"[157] [159]":gosub240:next
  96. 1090 close2:gosub350:goto470
  97. 1100 rem ******************************
  98. 1110 rem  sektoren des directory tracks
  99. 1120 rem ******************************
  100. 1130 data1,4,7,10,13,16,2,5,8,11,14,17,3,6,9,12,15,18
  101. 1140 rem ******************************
  102. 1150 rem  input maschinen-routine
  103. 1160 rem ******************************
  104. 1170 data32,253,174,32,158,183,32,30,225,32,253,174,32,158,183,138,72,32,253
  105. 1180 data174,32,139,176,133,73,132,74,32,163,182,104,32,117,180,160,2,185
  106. 1190 data97,0,145,73,136,16,248,200,32,18,225,145,98,200,196,97,208,246,32
  107. 1200 data204,255,96,0,0,0,0,0
  108. 1210 rem ******************************
  109. 1220 rem  scroll maschinen-routine
  110. 1230 rem ******************************
  111. 1240 data32,245,207,138,72,32,245,207,224,0,176,3,76
  112. 1250 data72,178,224,24,176,249,134,251,32,245,207,224,0,144,240,224,39,176
  113. 1260 data236,134,253,32,245,207,224,25,176,227,134,252,232,138,56,229,251
  114. 1270 data144,218,240,216,133,250,32,245,207,224,40,176,207,228,253,144,203
  115. 1280 data134,254,104,170,165,172,72,165,173,72,165,174,72,165,175,72,224,0
  116. 1290 data208,22,166,251,198,250,240,44,32,240,233,232,189,240,236,133,172
  117. 1300 data181,217,32,219,207,48,236,202,240,3,76,72,178,166,252,198,250,240
  118. 1310 data16,32,240,233,202,189,240,236,133,172,181,217,32,219,207,48,236,164
  119. 1320 data254,32,240,233,32,36,234,169,32,145,209,136,196,253,16,249,76,88
  120. 1330 data233,41,3,13,136,2,133,173,32,224,233,164,254,177,172,145,209,177
  121. 1340 data174,145,243,136,196,253,16,243,96,32,253,174,76,158,183
  122.