next up previous contents index
Next: FSplit Up: Functions and Procedures Previous: FindNext

FSearch

   

Declaration:

Function FSearch (Path: pathstr; DirList: string) : pathstr;

Description:

FSearch searches the file Path in all directories listed in DirList. The full name of the found file is returned.

DirList must be a list of directories, separated by semi-colons (or colons under LINUX).

When no file is found, an empty string is returned.

Errors:

None.

See also:

FExpand

Example
Program Example10;
uses Dos;

{ Program to demonstrate the FSearch function. }

var
  s : string;
begin
  s:=FSearch(ParamStr(1),GetEnv('PATH'));
  if s='' then
   WriteLn(ParamStr(1),' not Found in PATH')
  else 
   Writeln(ParamStr(1),' Found in PATH at ',s);
end.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998