home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Help / activateHelpIndexes.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  1.4 KB  |  55 lines

  1. !!Script
  2. // Copyright ⌐ 1999 - Modelworks Software
  3. // @Created build 290 cm19990427
  4.  
  5. /**
  6. @Event: activateHelpIndexes~enable/diable help indexes
  7. @EndTool:
  8. @Summary: activateHelpIndexes~enable/diable help indexes
  9. */
  10.  
  11. var gOutput = getOutput();
  12. var gActiveHelpIndexes = getMapFile("ActiveHelpIndexes.map");
  13.  
  14. function DoCommand()
  15. {
  16.     var choiceList = newList();
  17.     var checkedList = newList();
  18.     
  19.     var position = gActiveHelpIndexes.getHeadPosition();
  20.     while (position && position.valid)
  21.     {
  22.         var association = gActiveHelpIndexes.getNext(position);
  23.         if (association)
  24.         {
  25.             choiceList.addTail(association.key);
  26.             checkedList.addTail(association.value);
  27.         }
  28.     }
  29.     
  30.     var resultList = chooseOptions("Active Help Indexes",
  31.     "Check the help indexes that will be loaded during startup", choiceList, checkedList);
  32.     
  33.     // result is a list of booleans 
  34.     if (resultList)
  35.     {
  36.         var listPosition = choiceList.getHeadPosition();
  37.         var resultPosition = resultList.getHeadPosition();
  38.         var checkedPosition = checkedList.getHeadPosition();
  39.         while (resultPosition.valid && listPosition.valid)
  40.         {
  41.             var selected = resultList.getNext(resultPosition);
  42.             var item = choiceList.getNext(listPosition);
  43.             var checked = checkedList.getNext(checkedPosition);
  44.             
  45.             if (selected != checked)
  46.             {
  47.                 gActiveHelpIndexes.setValue(item, selected);
  48.             }
  49.         }
  50.     }
  51. }
  52.  
  53. !!/Script
  54.  
  55.