Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Internet » StarterPak/!Newsbase/Transports/ka9q/delgroup » Compare
Compare StarterPak/!Newsbase/Transports/ka9q/delgroup with StarterPak/!Newsbase/Transports/ka9q/addgroup
| File: | Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199508.adf » !Internet » StarterPak/!Newsbase/Transports/ka9q/delgroup |
| Compared with: | Archimedes archive » Acorn User » AU 1995-08.adf » !Internet » StarterPak/!Newsbase/Transports/ka9q/addgroup |
| Similarity: | 66% of bytes duplicated |
168 of 193 lines (87.7%) are identical in the two listings. Duplicated Different
Line numbers are ignored when comparing lines, so that renumbered programs still match.
| StarterPak/!Newsbase/Transports/ka9q/delgroup | StarterPak/!Newsbase/Transports/ka9q/addgroup |
|---|---|
| 10REM >delgroup | 10REM >addgroup |
| 20REM remove group(s) from server list | 20REM add group(s) to server list |
| 30REM recoded to output files for !TCPIP 2.02 | 30REM recoded to output files for !TCPIP 2.02 |
| 40 | 40 |
| 50fh%=0 | 50fh%=0 |
| 60ONERROR REPORT:PRINT" at line ";ERL:END | 60ONERROR REPORT:PRINT" at line ";ERL:END |
| 70SYS"OS_GetEnv" TO A$ | 70SYS"OS_GetEnv" TO A$ |
| 80N$="":old%=FALSE | 80N$="":old%=FALSE |
| 90REPEAT | 90REPEAT |
| 100p$=FNgetpar(A$," ") | 100p$=FNgetpar(A$," ") |
| 110CASEp$OF | 110CASEp$OF |
| 120WHEN"-n":N$=FNgetpar(A$," ") | 120WHEN"-n":N$=FNgetpar(A$," ") |
| 130WHEN"-old":old%=TRUE | 130WHEN"-old":old%=TRUE |
| 140ENDCASE | 140ENDCASE |
| 150UNTILA$="" | 150UNTILA$="" |
| 160IFN$=""THENPROCexit(1,"No group parameter") | 160IFN$=""THENPROCexit(1,"No group parameter") |
| 170 | |
| 180DIM buf% 1024 | 170DIM buf% 1024 |
| 190 | 180 |
| 200grpmax%=(HIMEM-END-1000)DIV40 | 190grpmax%=(HIMEM-END-1000)DIV40 |
| 210IFgrpmax%<200 THEN grpmax%=200 | 200IFgrpmax%<200 THEN grpmax%=200 |
| 220DIMgrp$(grpmax%) | 210DIMgrp$(grpmax%) |
| 230 | 220 |
| 240REM eliminate any spaces from parameter | 230REM eliminate any spaces from parameter |
| 250g$=FNclean(N$) | 240g$=FNclean(N$) |
| 260 | 250 |
| 270d1$="<NNTP$Dir>" | 260d1$="<NNTP$Dir>" |
| 280SYS"XOS_File",17,d1$TOt%;F% | 270SYS"XOS_File",17,d1$TOt%;F% |
| 290IFt%=0OR(F%AND1)<>0 THEN | 280IFt%=0OR(F%AND1)<>0 THEN |
| 300 d1$="<TCPIP$Dir>":SYS"XOS_File",17,d1$TOt%;F% | 290 d1$="<TCPIP$Dir>":SYS"XOS_File",17,d1$TOt%;F% |
| 310 IFt%=0OR(F%AND1)<>0 THENPROCexit(1,"!TCPIP not found") | 300 IFt%=0OR(F%AND1)<>0 THENPROCexit(1,"!TCPIP not found") |
| 320ENDIF | 310ENDIF |
| 330 | 320 |
| 340next%=0:files%=0:found%=0 | 330next%=0:len%=-1:file$="":files%=0 |
| 350REM loop through xxxGroup files | 340REM find longest xxxGroup file (ie, major server) |
| 360REPEAT | 350REPEAT |
| 370 SYS"XOS_GBPB",9,d1$,buf%,1,next%,1024,"*Group"TO,,,no%,next%;F% | 360 SYS"XOS_GBPB",9,d1$,buf%,1,next%,1024,"*Group"TO,,,no%,next%;F% |
| 380 IFno%>0AND(F%AND1)=0THEN | 370 IFno%>0AND(F%AND1)=0THEN |
| 390 f$=FNstr(buf%) | 380 f$=FNstr(buf%) |
| 400 IFFNfilesize(d1$+"."+f$)>0THENfound%+=FNrmfile(d1$+"."+f$,g$):files%+=1 | 390 l%=FNfilesize(d1$+"."+f$) |
| 400 IFl%>len%THENlen%=l%:file$=f$ | |
| 410 ENDIF | 410 ENDIF |
| 420UNTILnext%<0 | 420UNTILnext%<0 |
| 430IFfile$=""PROCexit(1,"No xxxGroup files! Please setup your newsfeed.") | |
| 440found%=FNaddgroup(d1$+"."+file$,g$) | |
| 430IFfiles%=0PROCexit(1,"Couldn't open xxxGroup - is !TCPIP online?") | 450IFfiles%=0PROCexit(1,"Couldn't open xxxGroup - is !TCPIP online?") |
| 440IFfound%=0PROCexit(1,"Group not found") | 460IFfound%=0PROCexit(1,"Group not found") |
| 450PROCexit(0,"Group "+g$+" removed") | 470PROCexit(0,"Group "+g$+" added") |
| 460END | 480END |
| 470 | 490 |
| 480DEFFNrmfile(f$,g$) | 500DEFFNaddgroup(f$,g$) |
| 490LOCALfound% | 510LOCALl%,found%,a$ |
| 500SYS"XOS_Find",&4F,f$ TOfh%;F% | 520SYS"XOS_Find",&4F,f$ TOfh%;F% |
| 510IF(F%AND1) THENfh%=0:=0 | 530IF(F%AND1) THENfh%=0:=0 |
| 520 | |
| 530l%=0 | 540l%=0 |
| 540REPEAT | 550REPEAT |
| 550 A$=GET$#fh% | 560 A$=GET$#fh% |
| 560 WHILEA$>"" | 570 WHILEA$>"" |
| 570 grp$(l%)=FNgetpar(A$,","):l%+=1 | 580 grp$(l%)=FNgetpar(A$,","):l%+=1 |
| 580 ENDWHILE | 590 ENDWHILE |
| 590UNTILEOF#fh%ORl%=grpmax%-2 | 600UNTILEOF#fh%ORl%=grpmax%-2 |
| 600CLOSE#fh%:fh%=0 | 610CLOSE#fh%:fh%=0 |
| 610 | 620 |
| 620lastgroup%=l% | 630lastgroup%=l% |
| 630 | 640 |
| 640found%=0 | 650found%=0 |
| 650FORa%=0TOlastgroup% | 660FORa%=0TOlastgroup% |
| 660 a$=FNclean(grp$(a%)) | 670 a$=FNclean(grp$(a%)):test%=FNmatch(g$,a$) |
| 670 CASEFNmatch(g$,a$)OF | 680 CASEtest%OF |
| 680 WHEN0:REM leave l$=l$+g1$+"," | 690 WHEN0:REM leave l$=l$+g1$+"," |
| 690 WHEN1:found%=1:a$="" | 700 OTHERWISE:a$="":REM omit any kind of match |
| 700 WHEN2:found%=1:IFneg%=0THENgrp$(lastgroup%)="!"+g$:lastgroup%+=1:neg%=1 | |
| 710 WHEN-1:IFneg%=0THENgrp$(lastgroup%)="!"+g$:lastgroup%+=1:neg%=1 | |
| 720 WHEN-2:a$="":REM wild omit | |
| 730 ENDCASE | 710 ENDCASE |
| 740 grp$(a%)=a$ | 720 grp$(a%)=a$ |
| 750NEXT | 730NEXT |
| 740IFfound%=0THEN | |
| 750 grp$(lastgroup%+1)=g$ | |
| 760 found%=1 | |
| 770ENDIF | |
| 760REM write out new version of file | 780REM write out new version of file |
| 770F%=FNrename(f$,f$+"~") | 790F%=FNrename(f$,f$+"~") |
| 780SYS"XOS_Find",&8F,f$TOfh%;F% | 800SYS"XOS_Find",&8F,f$TOfh%;F% |
| 790IF(F%AND1) fh%=0:PROCexit(1,"Couldn't open output file") | 810IF(F%AND1) THENfh%=0:PROCexit(1,"Couldn't open output file") |
| 800files%+=1 | 820files%+=1 |
| 810PROCfixuplist | 830PROCfixuplist |
| 820IFold%THEN | 840IFold%THEN |
| 830 line$="" | 850 line$="" |
| 840 FORl%=0TOlastgroup%+2 | 860 FORl%=0TOlastgroup%+2 |
| 850 a$=grp$(l%) | 870 a$=grp$(l%) |
| 860 IFa$>""THEN | 880 IFa$>""THEN |
| 870 IFLENline$+LENa$<220THEN | 890 IFLENline$+LENa$<220THEN |
| 880 line$=line$+","+a$ | 900 line$=line$+","+a$ |
| 890 ELSE | 910 ELSE |
| 900 IFLEFT$(line$,1)=","THENline$=MID$(line$,2) | 920 IFLEFT$(line$,1)=","THENline$=MID$(line$,2) |
| 910 BPUT#fh%,line$:line$=a$ | 930 BPUT#fh%,line$:line$=a$ |
| 920 ENDIF | 940 ENDIF |
| 930 ENDIF | 950 ENDIF |
| 940 NEXTl% | 960 NEXTl% |
| 950 IFline$>""THENBPUT#fh%,line$ | 970 IFline$>""THENBPUT#fh%,line$ |
| 960 ELSE | 980 ELSE |
| 970 FORl%=0TOlastgroup%+2 | 990 FORl%=0TOlastgroup%+2 |
| 980 IFgrp$(l%)>""THENBPUT#fh%,grp$(l%) | 1000 IFgrp$(l%)>""THENBPUT#fh%,grp$(l%) |
| 990 NEXTl% | 1010 NEXTl% |
| 1000ENDIF | 1020ENDIF |
| 1010CLOSE#fh%:fh%=0:grp$()="" | 1030CLOSE#fh%:fh%=0 |
| 1020SYS"XOS_File",18,f$,&FFF | 1040SYS"XOS_File",18,f$,&FFF |
| 1030=found% | 1050=found% |
| 1040 | 1060 |
| 1050DEFPROCfixuplist | 1070DEFPROCfixuplist |
| 1060REM move negated groups onto ends of appropriate wildcarded lines | 1080REM move negated groups onto ends of appropriate wildcarded lines |
| 1070LOCALl%,l2%,c%,A$,B$ | 1090LOCALl%,l2%,c%,A$,B$ |
| 1080FORl%=0TOlastgroup%+2 | 1100FORl%=0TOlastgroup%+2 |
| 1090 IFLEFT$(grp$(l%),1)="!"THEN | 1110 IFLEFT$(grp$(l%),1)="!"THEN |
| 1100 A$=grp$(l%):grp$(l%)="" | 1120 A$=grp$(l%):grp$(l%)="" |
| 1110 l2%=0:WHILEl2%<lastgroup%+2 | 1130 l2%=0:WHILEl2%<lastgroup%+2 |
| 1120 B$=grp$(l2%):c%=INSTR(B$,","):IFc%>0THENB$=LEFT$(B$,c%-1) | 1140 B$=grp$(l2%):c%=INSTR(B$,","):IFc%>0THENB$=LEFT$(B$,c%-1) |
| 1130 IFRIGHT$(B$)="*"THEN | 1150 IFRIGHT$(B$)="*"THEN |
| 1140 REM test for match | 1160 REM test for match |
| 1150 IFMID$(A$,2,LENB$-1)=LEFT$(B$)THEN | 1170 IFMID$(A$,2,LENB$-1)=LEFT$(B$)THEN |
| 1160 IFLENgrp$(l2%)+LENA$<254THENgrp$(l2%)+=","+A$:l2%=lastgroup%+2 | 1180 IFLENgrp$(l2%)+LENA$<254THENgrp$(l2%)+=","+A$:l2%=lastgroup%+2 |
| 1170 ENDIF | 1190 ENDIF |
| 1180 ENDIF | 1200 ENDIF |
| 1190 l2%+=1:ENDWHILE | 1210 l2%+=1:ENDWHILE |
| 1200 ENDIF | 1220 ENDIF |
| 1210NEXTl% | 1230NEXTl% |
| 1220ENDPROC | 1240ENDPROC |
| 1230 | 1250 |
| 1240DEFFNgetgroup(RETURN A$) | 1260DEFFNgetgroup(RETURNA$) |
| 1250n%=INSTR(A$,",") | 1270n%=INSTR(A$,",") |
| 1260IFn%>0THEN | 1280IFn%>0THEN |
| 1270 B$=LEFT$(A$,n%-1):A$=MID$(A$,n%+1) | 1290 B$=LEFT$(A$,n%-1):A$=MID$(A$,n%+1) |
| 1280 ELSE | 1300 ELSE |
| 1290 B$=A$:A$="" | 1310 B$=A$:A$="" |
| 1300ENDIF | 1320ENDIF |
| 1310=FNclean(B$) | 1330=FNclean(B$) |
| 1320 | 1340 |
| 1330DEFFNmatch(g$,pat$) | 1350DEFFNmatch(g$,pat$) |
| 1360REM does group encompass an element of current list? | |
| 1340REM returns 0 nomatch, 1 direct match, 2 wild match (-ive for negated match) | 1370REM returns 0 nomatch, 1 direct match, 2 wild match (-ive for negated match) |
| 1350LOCALmatch%,neg%:match%=0:neg%=0 | 1380LOCALmatch%,neg%:match%=0:neg%=0 |
| 1360IFLEFT$(pat$,1)="!"THENneg%=1:pat$=MID$(pat$,2) | 1390IFLEFT$(pat$,1)="!"THENneg%=1:pat$=MID$(pat$,2) |
| 1370IFRIGHT$(pat$,1)="*"ANDpat$<>g$THEN | 1400IFRIGHT$(g$,1)="*"ANDpat$<>g$THEN |
| 1380 IFLEFT$(pat$,LENpat$-1)=LEFT$(g$,LENpat$-1)THENmatch%=2 | 1410 IFLEFT$(g$,LENg$-1)=LEFT$(pat$,LENg$-1)THENmatch%=2 |
| 1390 ELSE | 1420 ELSE |
| 1400 IFpat$=g$THENmatch%=1 | 1430 IFpat$=g$THENmatch%=1 |
| 1410ENDIF | 1440ENDIF |
| 1420IFneg%THENmatch%=-match% | 1450IFneg%THENmatch%=-match% |
| 1430=match% | 1460=match% |
| 1440 | 1470 |
| 1450DEFFNfilesize(f$) | 1480DEFFNfilesize(f$) |
| 1460LOCALs%:SYS"XOS_File",17,f$TO,,,,s%;F% | 1490LOCALs%:SYS"XOS_File",17,f$TO,,,,s%;F% |
| 1470IF(F%AND1)THENs%=-1 | 1500IF(F%AND1)THENs%=-1 |
| 1480=s% | 1510=s% |
| 1490 | 1520 |
| 1500DEFPROCexit(n%,a$) | 1530DEFPROCexit(n%,a$) |
| 1510IFfh%<>0 CLOSE#fh% | 1540IFfh%<>0 CLOSE#fh% |
| 1520OSCLI("set NewsBase$ReturnCode "+STR$n%) | 1550OSCLI("set NewsBase$ReturnCode "+STR$n%) |
| 1530OSCLI("set NewsBase$ReturnInfo "+a$) | 1560OSCLI("set NewsBase$ReturnInfo "+a$) |
| 1540END | 1570END |
| 1550 | 1580 |
| 1560DEFFNstr(a%) | 1590DEFFNstr(a%) |
| 1570LOCALa$:WHILE ?a%>31ANDLENa$<255:a$+=CHR$?a%:a%+=1:ENDWHILE | 1600LOCALa$:WHILE ?a%>31ANDLENa$<255:a$+=CHR$?a%:a%+=1:ENDWHILE |
| 1580=a$ | 1610=a$ |
| 1590 | 1620 |
| 1600DEFFNrename(s$,d$) | 1630DEFFNrename(s$,d$) |
| 1610LOCALF%:SYS"XOS_FSControl",25,s$,d$TOerr%;F% | 1640LOCALF%:SYS"XOS_FSControl",25,s$,d$TOerr%;F% |
| 1620IF(F%AND1) THEN | 1650IF(F%AND1) THEN |
| 1630 F%=FNdelfile(d$) | 1660 F%=FNdelfile(d$) |
| 1640 SYS"XOS_FSControl",25,s$,d$TOerr%;F% | 1670 SYS"XOS_FSControl",25,s$,d$TOerr%;F% |
| 1650ENDIF | 1680ENDIF |
| 1660=(F%AND1) | 1690=(F%AND1) |
| 1670 | 1700 |
| 1680DEFFNmovefile(s$,d$) | 1710DEFFNmovefile(s$,d$) |
| 1690LOCALF%:F%=FNrename(s$,d$) | 1720LOCALF%:F%=FNrename(s$,d$) |
| 1700IFF%<>0SYS"XOS_FSControl",26,s$,d$,(1<<7) TO;F% | 1730IFF%<>0SYS"XOS_FSControl",26,s$,d$,(1<<7) TO;F% |
| 1710=(F%AND1) | 1740=(F%AND1) |
| 1720 | 1750 |
| 1730DEFFNdelfile(f$) | 1760DEFFNdelfile(f$) |
| 1740LOCALF%:SYS"XOS_File",6,f$TO;F% | 1770LOCALF%:SYS"XOS_File",6,f$TO;F% |
| 1750=(F%AND1) | 1780=(F%AND1) |
| 1760 | 1790 |
| 1770DEFFNclean(B$) | 1800DEFFNclean(B$) |
| 1780WHILELEFT$(B$,1)=" ":B$=MID$(B$,2):ENDWHILE | 1810WHILELEFT$(B$,1)=" ":B$=MID$(B$,2):ENDWHILE |
| 1790WHILERIGHT$(B$,1)=" ":B$=LEFT$(B$,LENB$-1):ENDWHILE | 1820WHILERIGHT$(B$,1)=" ":B$=LEFT$(B$,LENB$-1):ENDWHILE |
| 1800=B$ | 1830=B$ |
| 1810 | 1840 |
| 1820DEFFNgetpar(RETURN A$,s$) | 1850DEFFNgetpar(RETURN A$,s$) |
| 1830LOCALB$,l% | 1860LOCALB$,l% |
| 1840l%=INSTR(A$,s$) | 1870l%=INSTR(A$,s$) |
| 1850IFl%>0THEN | 1880IFl%>0THEN |
| 1860 B$=LEFT$(A$,l%-1):A$=MID$(A$,l%+1) | 1890 B$=LEFT$(A$,l%-1):A$=MID$(A$,l%+1) |
| 1870 ELSE | 1900 ELSE |
| 1880 B$=A$:A$="" | 1910 B$=A$:A$="" |
| 1890ENDIF | 1920ENDIF |
| 1900=B$ | 1930=B$ |
.