10 DIM block% 12,osfile% 17,name% 11
20
30MODE 7
40 IF FNfiling`system<>8 THEN PRINT"T
his Utility is ONLY available for ADFS":
END
50 PRINT" Winny search utility v1.01"
'" Adapted by John Carpenter from a"'" u
tility by Gary Davies."
60PRINT" Resolve Comms 0582 832653 Vi
ewdata"
70 files%=0
80 directory%=0
90PRINT'" This program will search an
ADFS disk/ winny for a program.NB with
this version,it is case sensitiv
e "'
100INPUT'" Enter dir to search from "r
oot$
110INPUT'" Enter string "search$
120SEARCH$=search$
130IFroot$=""THEN root$="$"
140 PRINT'" Output to Printer <Y/N> :
";
150 IF FNyes`no THEN VDU2
160CLS
170PRINT" Directory ";root$
180PRINT" String ";SEARCH$
190PRINT''" Searching..."''
200 PROCread`dir(root$,0)
210PRINT'" Search ended"
220 VDU3
230 END
240
250 DEF PROCread`dir(path$,seq%)
260 LOCAL end`dir%,file$
270 directory%=directory%+1
280 OSCLI("DIR "+path$)
290 REPEAT
300 file$=FNtrunk(FNread`filename(seq%
))
310 IF end`dir%=49 THEN 380
320 IF FNtest`dir(file$) THEN PROCread
`dir(path$+"."+file$,0):GOTO380
330 X$=path$+"."+file$
340 Z$=file$
350PROCcheck(SEARCH$)
360IFcheck$=search$ THEN PRINT" ";X$
370 files%=files%+1
380 UNTIL end`dir%=49
390 *DIR ^
400 ENDPROC
410
420 DEF FNlink(length%,memory%)
430 LOCAL loop%,total$
440 FOR loop%=memory% TO memory%+lengt
h%-1
450 total$=total$+CHR$(?loop%)
460 NEXT
470 =total$
480
490 DEF FNtest`dir(filename$)
500 LOCAL A%,X%,Y%,type%
510 $name%=filename$
520 ?osfile%=name% MOD 256
530 ?(osfile%+1)=name% DIV 256
540 X%=osfile% MOD 256
550 Y%=osfile% DIV 256
560 A%=5
570 type%=USR &FFDD MOD &100
580 IF type%=2 THEN =TRUE ELSE =FALSE
590
600 DEF FNread`filename(seqence%)
610 LOCAL A%,X%,Y%
620 A%=8
630 X%=block% MOD 256
640 Y%=block% DIV 256
650 !(block%+1)=name%
660 !(block%+5)=1
670 !(block%+9)=seqence%
680 end`dir%=USR &FFD1 DIV &1000000
690 seq%=!(block%+9)
700 =FNlink(?name%,name%+1)
710
720 DEF FNtrunk(string$)
730 LOCAL loop%
740 loop%=LEN(string$)
750 REPEAT
760 loop%=loop%-1
770 UNTIL MID$(string$,loop%+1,1)<>" "
780 =LEFT$(string$,loop%+1)
790
800 DEF FNyes`no
810 LOCAL key$
820 REPEAT
830 key$=GET$
840 UNTIL INSTR("YyNn",key$)<>0
850 IF INSTR("Yy",key$)<>0 THEN PRINT"
Yes";:=TRUE
860 PRINT" No";
870 =FALSE
880
890 DEF FNfiling`system
900 LOCAL X%,Y%,A%
910 A%=0
920 X%=&86
930 Y%=0
940 =USR &FFDA MOD &100
950DEF PROCcheck(z$)
960f%=FALSE
970FORn%=1 TO LEN(Z$)
980 a%=INSTR(Z$,z$)
990IFa%<>0 THEN f%=a%
1000NEXTn%
1010IF NOT f% check$=MID$(Z$,a%,LEN(z$)
)
1020ENDPROC
1030 DEFFNcase(s$)
1040 IF s$="" THEN =""
1050 SP%=0
1060 s2$=""
1070 FOR g%=1 TO LEN(s$)
1080 IF MID$(s$,g%,1)=" " THEN SP%=TRUE
:a%=32:GOTO1140
1090 IF g%=1 THEN SP%=TRUE
1100 a%=ASC(MID$(s$,g%,1))
1110 IF g%=1 THEN 1130
1120 IF SP%=0 THEN IF a%>96 AND a%<127:
ELSE IF SP%=0 AND a%>=65 AND a%<=90 THEN
a%=a%+32
1130 IF SP% AND a%>96 AND a%<127 THEN a
%=(a% AND &DF)
1140 s2$=s2$+CHR$a%
1150 IF SP% AND a%<>32 THEN SP%=0
1160 NEXT g%
1170 =s2$