home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / LISTDESTINATIONFILES.SCRIPT < prev    next >
Encoding:
Text File  |  2002-03-27  |  1.5 KB  |  69 lines

  1. !!Script
  2. // Copyright ⌐ 1997-2000 - Modelworks Software
  3.  
  4. /**
  5. @Tool: listDestinationFiles~displays the list of files
  6. to be built. 
  7. @EndTool: 
  8. @Summary: listDestinationFiles~displays the list of files to be built 
  9. */
  10.  
  11. function DoCommand()
  12. {
  13.   saveAll();
  14.   
  15.   var project = getCurrentProject();
  16.     
  17.   if (project)
  18.   {
  19.     var output = getOutput();
  20.     output.clear();
  21.     output.writeLine("Destination file list");
  22.     var packageList = project.getPackageList();
  23.     var position = packageList.getHeadPosition();
  24.     
  25.     if (!position.valid)
  26.     {
  27.       output.writeLine("\nNo packages are included in this project");
  28.     }
  29.     
  30.     var count = 0;
  31.     while (position && position.valid)
  32.     {
  33.       count += ListPackageInfo(packageList.getNext(position));
  34.     }
  35.     
  36.     output.writeLine("Number of class files: " + count);
  37.     output.writeLine("\nReport completed");
  38.   }
  39.   else
  40.   {
  41.     alert("A project must be open before you get project info");
  42.   }
  43. }
  44.  
  45. function ListPackageInfo(p)
  46. {
  47.   var output = getOutput();
  48.   
  49.   if (p.name.length > 0)
  50.   {
  51.     output.writeLine("------ Package " + p.name);
  52.   }
  53.   else
  54.   {
  55.     output.writeLine("------ Package " + "Untitled");
  56.   }
  57.  
  58.   var outOfDateFileList = p.getDestinationFileList(); 
  59.   var position = outOfDateFileList.getHeadPosition();
  60.   while (position.valid)
  61.   {
  62.     output.writeLine(outOfDateFileList.getNext(position).path);
  63.   }
  64.   return outOfDateFileList.count;
  65. }
  66.  
  67.  
  68. !!/Script
  69.