home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / CDSG.ZIP / CDLIST.PAS < prev    next >
Pascal/Delphi Source File  |  1993-09-20  |  1KB  |  34 lines

  1. uses TpDos, TpString, DOS;
  2. var StoredPath, CDSGdir, ext, fullname : string;
  3.     cdsgfile : text;
  4.     x : integer;
  5.     rec : searchRec;
  6.  
  7. procedure error(s:string);
  8. begin
  9.   writeln('Error: ',s);
  10.   writeln('Type CDS for instructions.');
  11.   writeln;
  12.   halt(1);
  13.   end;
  14.  
  15.  
  16. begin
  17.   writeln('Change Directory Set/Go - by GLen');
  18.   writeln('CDList - Lists keys and directories currently saved.');
  19.   CDSGdir:=GetEnv('CDSG');
  20.   if CDSGdir='' then error ('Environment string CDSG is not set.');
  21.   findfirst(CDSGdir+'\*.*', AnyFile-Directory, rec);
  22.   writeln('Stored Key         Path refered to by Key');
  23.   writeln('-----------------  --------------------------------------------');
  24.   while DOSError = 0 do begin
  25.      assign(cdsgfile,CDSGdir+'\'+rec.name);
  26.      if IOResult <> 0 then error('Problem with Environment string CDSG.');
  27.      reset(cdsgfile);
  28.      readln(cdsgfile,StoredPath);
  29.      if StoredPath='' then error('Problem with CDSG system - file empty...');
  30.      writeln(Pad(rec.name,19),StoredPath);
  31.      FindNext(rec);
  32.      end;
  33. end.
  34.