home *** CD-ROM | disk | FTP | other *** search
/ Zodiac Super OZ / MEDIADEPOT.ISO / FILES / 13 / MLUTL100.ZIP / MLDROP.PAS < prev    next >
Pascal/Delphi Source File  |  1996-07-12  |  1KB  |  51 lines

  1. {$M 5120,0,655360}
  2. {$N-,E- no math support needed}
  3. {$X- function calls may not be discarded}
  4. {$I- disable I/O checking (trap errors by checking IOResult)}
  5. {$DEFINE MLDROP}
  6.  
  7. USES DOS;
  8. {$I ML_INC.PAS}
  9.  
  10. VAR
  11.   Total : WORD;
  12.   NameList : ListLink;
  13.   ParamIndex : BYTE;
  14.   WorkFile : STRING;
  15.  
  16.   ListPath  : PATHSTR;    { List file path. }
  17.   ListDir   : DIRSTR;     { List file dir.  }
  18.   FileInfo : SEARCHREC;
  19.  
  20. BEGIN
  21.   IF ParamCount < 2 THEN ExitOnError (1, 'Insufficient number of parameters.');
  22.   NameList := NIL;
  23.   Total := 0;
  24.  
  25.   IF NOT IsFile (ParamStr (1))
  26.     THEN ExitOnError (3, 'The "MasterList" file was not found.');
  27.  
  28.   AddToList (NameList, ParamStr (1), Total);
  29.   EditList (NameList, Total);
  30.   WriteLn ('Starting with ', Total, ' unique members.');
  31.  
  32.   FOR ParamIndex := 2 to ParamCount DO
  33.   BEGIN
  34.     ListPath := GetFilePath (ParamStr (ParamIndex), ListDir);
  35.     FindFirst (ListPath, Archive, FileInfo);
  36.  
  37.     WHILE DosError = 0 DO
  38.     BEGIN
  39.       DropFromList (NameList, ListDir + FileInfo.Name, Total);
  40.       WriteLn ('Total members now: ', Total);
  41.       FindNext (FileInfo);
  42.     END;
  43.   END;
  44.  
  45.   EditList (NameList, Total);
  46.   WriteLn ('Unique members: ', Total);
  47.  
  48.   WriteList (NameList, ParamStr (1), Total);
  49.   WriteLn ('Finished consolidating lists.');
  50. END.
  51.