home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_18_1987_Transactor_Publishing.d64 / compare (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  3KB  |  102 lines

  1. 10 poke56,64:clr:co=06:cr=02:cb=1:poke646,co:poke53280,cr:poke53281,cb
  2. 20 if peek(26636)=51 and peek(26638)=52 then100
  3. 30 gosub940:print"[211][212][193][206][196][194][217] - [204]oading [205][204] [211]ubroutines.       "
  4. 40 dn%=peek(186):load"cmp.ml.6800",dn%,1
  5. 100 hd$="* [198]ile [195]omparison [213]tility   [214]3.4 *"
  6. 110 bx$="**********************************"
  7. 120 rem of$=chr$(160):nf$=chr$(176)
  8. 130 mm%=0:rc%=0:cr$=chr$(13):ze$=chr$(0):fori=1to16:sp$=sp$+chr$(160):next
  9. 140 ov$="":ot$="":oz$="":os$="":ob%=0:oy%=0
  10. 150 nv$="":nt$="":nz$="":ns$="":nb%=0:ny%=0
  11. 160 :
  12. 170 gosub940
  13. 180 dn%=0:input"[196]isk unit nr (8-11)";dn%:if dn%=0 then end
  14. 190 if dn%<8 or dn%>11 then print"[213]nit nr must be 8-11":goto180
  15. 200 gosub940:ol$="":input"[207][204][196] file name or $[146]";ol$
  16. 210 if ol$="$" then gosub970:goto200
  17. 220 if ol$="" then170
  18. 230 nu$="":input"[206][197][215] file name or *[146]";nu$
  19. 240 if nu$="$" then gosub970:gosub940:goto200
  20. 250 if nu$="" then200
  21. 260 pd$="":input"[210]eport to s[146]creen or p[146]rinter";pd$
  22. 270 if pd$="" then230
  23. 280 if pd$="s" then pn%=3:pc%=0:goto310
  24. 290 if pd$="p" then pn%=4:pc%=7:goto310
  25. 300 goto260
  26. 310 :
  27. 320 :rem--- get file type, trk, sector
  28. 330 oo$=left$(ol$+sp$,16)
  29. 340 nn$=left$(nu$+sp$,16)
  30. 350 sys26627:if nu$="*" then ny%=1:nb%=0
  31. 360 if rc%<128 then400
  32. 370 if rc%<255 then a$="failed.":goto390
  33. 380 a$="cancelled."
  34. 390 print"[196]irectory search ";a$:goto440
  35. 400 if oy%<>0 and ny%<>0 then480
  36. 410 if oy%=0 then print"[207][204][196] file not found."
  37. 420 if ny%=0 then print"[206][197][215] file not found."
  38. 430 print"[197]nter $[146] to list the disk directory."
  39. 440 print"[208]ress any key to continue"
  40. 450 get a$:if a$="" then450
  41. 460 goto200
  42. 470 :
  43. 480 :rem--- get report and record type
  44. 490 os$=ze$:print"[195]hoose a[146]scii";
  45. 500 if oy%=2 then print",b[146]asic,d[146]isassembly";
  46. 510 ov$="":input",hex[146]";ov$
  47. 520 if ov$="a" or ov$="x" then580
  48. 530 if oy%=2 and ov$="b" then ot$="c":oz$=chr$(0):goto820
  49. 540 if oy%=2 and ov$="d" then ot$="f":oz$=chr$(1):goto820
  50. 550 if ov$="" then goto820
  51. 560 goto490
  52. 570 :rem--- record specification
  53. 580 ot$="":input"[201]s record length f[146]ixed or v[146]ariable";ot$
  54. 590 if ot$="f" then630
  55. 600 if ot$="v" then660
  56. 610 if ot$="" then490
  57. 620 goto580
  58. 630 x=0:input"[211]pecify record length (1-255)";x:if x<1 or x>255 then580
  59. 640 oz$=chr$(x):goto820
  60. 650 :rem--- variable ln record
  61. 660 print"[195]hoose end of record indicator..."
  62. 670 ot$="":input"       c[146]haracter, l[146]ength, or m[146]ask";ot$
  63. 680 if ot$="c" then a$="character":goto730
  64. 690 if ot$="m" then a$="mask":goto730
  65. 700 if ot$="l" then790
  66. 710 if ot$="" then580
  67. 720 goto660
  68. 730 x$="":print"[197]nter value of ";a$;" (0-255)";:input x$:if x$="" then660
  69. 740 x=val(x$):if x<0 or x>255 then730
  70. 750 oz$=chr$(x)
  71. 760 x$="":input "[197]nter minimum record length (0-255)";x$:if x$="" then730
  72. 770 x=val(x$):if x<0 or x>255 then760
  73. 780 os$=chr$(x):goto820
  74. 790 x$="":input "[211]pecify the location (1-255)";x$:if x$="" then760
  75. 800 x=val(x$):if x<1 or x>255 then790
  76. 810 oz$=chr$(x)
  77. 820 if ov$="" then260
  78. 830 nv$=ov$:nt$=ot$:nz$=oz$:ns$=os$
  79. 840 :
  80. 850 :rem--- produce comparison report
  81. 860 a$=chr$(147):b$="   ":if pn%<>3 then a$=chr$(12):b$="                "
  82. 870 open pn%,pn%,pc%
  83. 880 print#pn%,a$;b$;bx$;cr$;b$;hd$;cr$;b$;bx$;cr$
  84. 890 print#pn%,b$;"[207][204][196] [206]ame: ";ol$
  85. 900 print#pn%,b$;"[206][197][215] [206]ame: ";nu$;cr$
  86. 910 sys26624:gosub990:goto200
  87. 920 :
  88. 930 :--- display screen header
  89. 940 print"[147]"chr$(14)tab(3)hd$cr$cr$:return
  90. 950 :
  91. 960 :--- list directory
  92. 970 pn%=3:nu$="*":open pn%,pn%,pc%:sys26630
  93. 980 :
  94. 990 a$="[195]ompare ":if nu$="*" then a$="[204]isting "
  95. 1000 b$="finished.":if rc%>99 then b$="failed.":if rc%=255 then b$="cancelled."
  96. 1010 if nu$<>"*" then b$=b$+str$(mm%)+" mismatches."
  97. 1020 print#pn%,cr$cr$a$b$:print#pn%:close pn%
  98. 1030 if pn%<>3 then1060
  99. 1040 print"[208]ress any key to continue."
  100. 1050 get a$:if a$="" or a$=chr$(136) then1050
  101. 1060 return
  102.