home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1986 December
/
1986-12.d64
/
mis-matcher_64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
67 lines
10 sa=49152:cs=10600:fr=251:print"[147]"
20 fort=satosa+65:reada:x=x+a:poket,a:next
30 ifx<>csthenprint"error in data statements.":stop
40 printchr$(14)
50 input"[206]ame of first program ";f1$:input"[206]ame of second program";f2$
60 print"[147][207]utput to [208]rinter? [217]/[206]"
70 get sp$:ifsp$="" then70
80 ifsp$="y"then open 4,4,7:print#4,"[195]omparing "f1$" to "f2$".":print#4
90 j$=" [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]"
100 open 2,8,2,f1$:open 3,8,3,f2$:gosub650
110 fort=1to2:get#2,a$:get#3,b$:next:rem throw away first 2 bytes
120 fort=1to2:get#2,a$:get#3,b$:next:rem throw away line links
130 a=0:ifa$<>""thena=asc(a$)
140 b=0:ifb$<>""thenb=asc(b$)
150 if a=0 and b=0 then300
160 ifa=0thenla=64000:goto180
170 gosub480:rem get line number
180 ifb=0thenlb=64000:goto200
190 gosub520:rem get line number
200 ifla<>lb then gosub320:rem check for different line #
210 ifla=64000andlb=64000then300
220 print"[195]hecking line"la:print"[145]";
230 sys sa
240 if peek(fr+1)=0 then120
250 print j$ "[204]ines"la"do not agree."
260 if sp$<>"y" then120
270 if tg=1 then print#4
280 tg=0:print#4,"[204]ines"la"do not agree."
290 goto120
300 close2:close3:close4:end
310 rem -- extra line
320 if la>=lb then390
330 print j$"[204]ine"la"in "f1$" [146] not in "f2$"."
340 if sp$="y" and tg=0 then print#4
350 tg=1:if sp$="y" then print#4,"[204]ine"la"in "f1$" not in "f2$"."
360 poke fr,2:sys sa+55
370 get#2,a1$:get#2,a2$:if a1$="" and a2$="" then la=64000:goto320
380 gosub480:goto320:rem get new line #
390 if lb>=la then460
400 print j$"[204]ine"lb"in "f2$" [146] not in "f1$"."
410 if sp$="y" and tg=0 then print#4
420 tg=1:if sp$="y" then print#4,"[204]ine"lb"in "f2$" not in "f1$"."
430 poke fr,3:sys sa+55
440 get#3,b1$:get#3,b2$:ifb1$=""andb2$=""thenlb=64000:goto320
450 gosub520:goto320
460 return
470 rem -- get line numbers
480 get#2,a1$:get#2,a2$
490 a1=0:ifa1$<>""thena1=asc(a1$)
500 a2=0:ifa2$<>""thena2=asc(a2$)
510 la=a2*256+a1:return
520 get#3,b1$:get#3,b2$
530 b1=0:ifb1$<>""thenb1=asc(b1$)
540 b2=0:ifb2$<>""thenb2=asc(b2$)
550 lb=b2*256+b1:return
560 data 169,0,133,252,162,2,32,198
570 data 255,160,255,200,32,207,255,240
580 data 6,153,66,192,76,11,192,132
590 data 251,162,3,32,198,255,160,255
600 data 200,32,207,255,240,10,217,66
610 data 192,240,245,230,252,76,32,192
620 data 196,251,240,2,230,252,96,166
630 data 251,32,198,255,32,207,255,208
640 data 251,96
650 open15,8,15:input#15,a,b$,c,d:ifathenprinta,b$,c,d:stop
660 return