me with this project. In time I hope I can help someone using
PB products. TIA

Tony D'Andrea
[email protected]
------------------
$IF 0 A recursive file finder Various bits of this code were pinched from a wide range other people - thanks to them Dave Stanton 8/03/2001 $ENDIF DIM DYNAMIC Fils$(1:1) Filemask$="PB*.EXE" Rootpath$="C:\" F??= Whereis(Filemask$,Rootpath$,Fils$()) PRINT Fils$(1) FOR Q?? = 2 TO F?? PRINT Fils$(Q??) NEXT Q?? PRINT USING$("###### Files",F??) FUNCTION Whereis(Filemask$,Rootpath$,Fils$()) PUBLIC AS WORD LOCAL D$(),Fptr??,Dptr?? DIM D$(0:100) Fptr??=0 Dptr??=0 D$(0)=Rootpath$ Whereinbranch Filemask$,Fils$(),Fptr??,D$(),Dptr?? IF Fptr?? THEN REDIM PRESERVE Fils$(1:Fptr??) ELSE Fils$(1)="No matching files for "+Filemask$ END IF FUNCTION=Fptr?? END FUNCTION SUB Whereinbranch(Filemask$,Fils$(),Fptr??,D$(),Dptr??) SHARED Dmax?? LOCAL Z$(),Q??,Newsize??,Chunk? DIM Z$(1:10) Chunk?=25 'Extra room in Fils$() Lpath$=RTRIM$(D$(Dptr??)) IF RIGHT$(Lpath$,1)<>"\" THEN Lpath$=Lpath$+"\" Q??=Getfilenames(Lpath$+Filemask$,Z$(),0)'Files IF Fptr??+Q??>UBOUND(Fils$) THEN Newsize??=Fptr??+Q??+Chunk? REDIM PRESERVE Fils$(1:Newsize??) END IF FOR P??=1 TO Q?? INCR Fptr?? Fils$(Fptr??)=Lpath$+Z$(P??) NEXT P?? Q??=Getfilenames(Lpath$+"*.*",Z$(),1)'Subdir FOR P??=1 TO Q?? INCR Dptr?? D$(Dptr??)=Lpath$+Z$(P??) Whereinbranch Filemask$,Fils$(),Fptr??,D$(),Dptr?? NEXT P?? Dmax??=MAX(Dmax??,Dptr??) Dptr??=Dptr??-Q?? END SUB FUNCTION Getfilenames(Fmask$,Z$(),Flag?) PUBLIC AS WORD LOCAL Filname$,Q$,Q1$,Attr? Q$="" IF Flag?=0 THEN Attr?=0 ' Normal files IF Flag?=1 THEN Attr?=16 ' Sub directories Filname$=DIR$(Fmask$,Attr?) DO UNTIL Filname$="" Readdta Filn$,Fsize???,Fattr?,Tim$,Dat$ IF (Fattr? AND Attr?)=Attr? THEN Q1$=SPACE$(12) MID$(Q1$,1,12)=Filname$ Q$=Q$+Q1$ END IF Filname$=DIR$ LOOP Alen??=LEN(Q$)/12 IF Alen?? THEN REDIM Z$(1:Alen??) FOR Q??= 1 TO Alen?? Z$(Q??)=MID$(Q$,Q??*12-11,12) NEXT Q?? ELSE Z$(1)="" 'No matching files END IF FUNCTION=Alen?? END FUNCTION SUB Readdta(Filname$,Fsize???,Fattr?,Tim$,Dat$) PUBLIC LOCAL Dtaseg??,Dtaoff?,Temp? Getdta Dtaseg??,Dtaoff?? DEF SEG = Dtaseg?? Fattr?=PEEK(Dtaoff?? + &H15) Temp??=BITS??(PEEKI(Dtaoff??+&H16)) Secs?=2*(Temp?? AND &H1F) SHIFT RIGHT Temp??,5 Mins?=Temp?? AND &H3F SHIFT RIGHT Temp??,6 Hour?=Temp?? AND &H1F Tim$= Zpad$(Hour?)+":"+Zpad$(Mins?)+":"+Zpad$(Secs?) Temp??=BITS??(PEEKI(Dtaoff??+&H18)) Day?= Temp?? AND &H1F SHIFT RIGHT Temp??,5 Mon?= Temp?? AND &H0F SHIFT RIGHT Temp??,4 Year?=80+(Temp?? AND &H7F) Dat$= Zpad$(Day?)+"/"+Zpad$(Mon?)+"/"+Zpad$(Year?) Fsize???=BITS???(PEEKL(Dtaoff??+&H1A)) Filname$=PEEK$(Dtaoff??+&H1E,13) DEF SEG END SUB SUB Getdta(Dtaseg??,Dtaoff??) PUBLIC ! push ds ! push si ! mov ax,&H2F00 ! int &h21 ! lds si,Dtaseg?? ! mov ds:[si],es ! lds si,Dtaoff?? ! mov ds:[si],bx ! pop si ! pop ds END SUB FUNCTION Zpad$(BYVAL N) PUBLIC FUNCTION=Charpad$(N,2,48) END FUNCTION FUNCTION Charpad$(BYVAL N,BYVAL Siz?,BYVAL Pchar?) PUBLIC LOCAL Temp$ Temp$=STRING$(Siz?,Pchar?)+Ltrim$(STR$(N)) FUNCTION=RIGHT$(Temp$,Siz?) END FUNCTION
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: