home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp21beta.zip / LEXMPSRC.RAR / SEARCH.PAS < prev    next >
Pascal/Delphi Source File  |  2000-08-15  |  976b  |  40 lines

  1. {█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█}
  2. {█                                                       █}
  3. {█      Virtual Pascal for Linux                         █}
  4. {█      Test example for file searching                  █}
  5. {█      ─────────────────────────────────────────────────█}
  6. {█      Copyright (C) 1999 Joerg Pleumann                █}
  7. {█                                                       █}
  8. {▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀}
  9.  
  10. program Search;
  11.  
  12. uses
  13.   Dos;
  14.  
  15. var
  16.   Path, Name: string;
  17.   I: Integer;
  18.  
  19. begin
  20.   FileSystem := fsDos;
  21.  
  22.   Path := GetEnv('PATH');
  23.  
  24.   for I := 1 to Length(Path) do
  25.   begin
  26.     if Path[I] = ':' then Path[I] := ';';
  27.     if Path[I] = '/' then Path[I] := '\';
  28.   end;
  29.  
  30.   Write('Enter a file name to search: '); ReadLn(Name);
  31.  
  32.   Name := FSearch(Name, Path);
  33.  
  34.   if Name = '' then
  35.     WriteLn('Sorry, not found.')
  36.   else
  37.     WriteLn('Complete name is: ', Name);
  38.  
  39. end.
  40.