home *** CD-ROM | disk | FTP | other *** search
- uses
- crt, dos, eco_lib
-
- ;
-
- const
- display : boolean = false;
- withgoto : boolean = true;
- witherrlev : boolean = false;
-
-
-
- function __getpath(var fname : string) : boolean;
- { returns the full path and filename for a filename if the file }
- { is found in the path. }
- var
- found : boolean;
- homedir,
- extractedpath : string;
- i, j, len : byte;
-
- begin
- homedir := __normfil(fname);
- if __existfil(homedir) then begin
- fname := homedir; __getpath := true; exit;
- end;
- j := 1; len := length(_dospath);
- repeat
- extractedpath := '';
- inc(j); i := j - 1;
- while (_dospath[j] <> ';') and (j < len) do inc(j); inc(j);
- extractedpath := __normfil(__backapp(copy(_dospath, i, j-i-1)));
- found := __existfil(__normfil(extractedpath + fname));
- if display then writeln(__slashfil(extractedpath + fname));
- if found then fname := __slashfil(extractedpath + fname);
- until (found) or (j >= len) or (i >= len);
- __getpath := found;
- end;
-
-
-
- var
- k : word;
- nam,
- st : string;
-
- begin
- display := __inparams('/d', k);
- withgoto := __inparams('/goto', k) or __inparams('/g', k);
- witherrlev := __inparams('/err', k);
- if __inparams('/?', k) then begin
- writeln(__progname);
- writeln(' /d :: display findings.');
- writeln(' /g /goto :: goto directory where found.');
- writeln(' /err :: end on errorlevel 1 when found.');
- writeln('Version 1.01 by Floor A.C. Naaijkens for');
- writeln('UltiHouse Software / The ECO Group.');
- writeln('FAX/BBS: x31,13,638709 - b300-57600 V32b/42b/HST/MNP');
- end;
- for k := 1 to paramcount do begin
- st := paramstr(k);
- if st[1] <> '/' then begin
- if __getpath(st) then begin
- if display then __write(wherex, wherey-1, 0, 7, st) else
- __write(wherex, wherey, 0, 7, st);
- if withgoto then begin
- chdir(__backrem(__extractpath(__normfil(st))))
- end;
- if witherrlev then halt(1);
- end;
- end;
- end;
- halt(0);
- end.
-