home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1986 December / 1986-12.d64 / mis-matcher_64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  67 lines

  1. 10 sa=49152:cs=10600:fr=251:print"[147]"
  2. 20 fort=satosa+65:reada:x=x+a:poket,a:next
  3. 30 ifx<>csthenprint"error in data statements.":stop
  4. 40 printchr$(14)
  5. 50 input"[206]ame of first program ";f1$:input"[206]ame of second program";f2$
  6. 60 print"[147][207]utput to [208]rinter?  [217]/[206]"
  7. 70 get sp$:ifsp$="" then70
  8. 80 ifsp$="y"then open 4,4,7:print#4,"[195]omparing "f1$" to "f2$".":print#4
  9. 90 j$="                    [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]"
  10. 100 open 2,8,2,f1$:open 3,8,3,f2$:gosub650
  11. 110 fort=1to2:get#2,a$:get#3,b$:next:rem  throw away first 2 bytes
  12. 120 fort=1to2:get#2,a$:get#3,b$:next:rem  throw away line links
  13. 130 a=0:ifa$<>""thena=asc(a$)
  14. 140 b=0:ifb$<>""thenb=asc(b$)
  15. 150 if a=0 and b=0 then300
  16. 160 ifa=0thenla=64000:goto180
  17. 170 gosub480:rem get line number
  18. 180 ifb=0thenlb=64000:goto200
  19. 190 gosub520:rem get line number
  20. 200 ifla<>lb then gosub320:rem  check for different line #
  21. 210 ifla=64000andlb=64000then300
  22. 220 print"[195]hecking line"la:print"[145]";
  23. 230 sys sa
  24. 240 if peek(fr+1)=0 then120
  25. 250 print j$ "[204]ines"la"do not agree."
  26. 260 if sp$<>"y" then120
  27. 270 if tg=1 then print#4
  28. 280 tg=0:print#4,"[204]ines"la"do not agree."
  29. 290 goto120
  30. 300 close2:close3:close4:end
  31. 310 rem --                                     extra line
  32. 320 if la>=lb then390
  33. 330 print j$"[204]ine"la"in  "f1$" [146] not in  "f2$"."
  34. 340 if sp$="y" and tg=0 then print#4
  35. 350 tg=1:if sp$="y" then print#4,"[204]ine"la"in "f1$" not in "f2$"."
  36. 360 poke fr,2:sys sa+55
  37. 370 get#2,a1$:get#2,a2$:if a1$="" and a2$="" then la=64000:goto320
  38. 380 gosub480:goto320:rem get new line #
  39. 390 if lb>=la then460
  40. 400 print j$"[204]ine"lb"in  "f2$" [146] not in  "f1$"."
  41. 410 if sp$="y" and tg=0 then print#4
  42. 420 tg=1:if sp$="y" then print#4,"[204]ine"lb"in "f2$" not in "f1$"."
  43. 430 poke fr,3:sys sa+55
  44. 440 get#3,b1$:get#3,b2$:ifb1$=""andb2$=""thenlb=64000:goto320
  45. 450 gosub520:goto320
  46. 460 return
  47. 470 rem -- get line numbers
  48. 480 get#2,a1$:get#2,a2$
  49. 490 a1=0:ifa1$<>""thena1=asc(a1$)
  50. 500 a2=0:ifa2$<>""thena2=asc(a2$)
  51. 510 la=a2*256+a1:return
  52. 520 get#3,b1$:get#3,b2$
  53. 530 b1=0:ifb1$<>""thenb1=asc(b1$)
  54. 540 b2=0:ifb2$<>""thenb2=asc(b2$)
  55. 550 lb=b2*256+b1:return
  56. 560 data 169,0,133,252,162,2,32,198
  57. 570 data 255,160,255,200,32,207,255,240
  58. 580 data 6,153,66,192,76,11,192,132
  59. 590 data 251,162,3,32,198,255,160,255
  60. 600 data 200,32,207,255,240,10,217,66
  61. 610 data 192,240,245,230,252,76,32,192
  62. 620 data 196,251,240,2,230,252,96,166
  63. 630 data 251,32,198,255,32,207,255,208
  64. 640 data 251,96
  65. 650 open15,8,15:input#15,a,b$,c,d:ifathenprinta,b$,c,d:stop
  66. 660 return
  67.