home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR24 / MAKEBOOK.ZIP / MAKEBOOK.CMD next >
OS/2 REXX Batch file  |  1993-07-27  |  11KB  |  180 lines

  1. /* 
  2.         REXX utility that will search all available drives for OS/2 Online Reference Manuals (.INF files)
  3.         MAKEBOOK.CMD
  4.         Version 1.02
  5.         By: Derek Berube
  6.  
  7.         03.16.93 v1.00
  8.              *  Initial Release
  9.         07.07.93 v1.01
  10.              *  Fixed a problem with parameters field of the object that is created.  The drive on which the
  11.                 .INF file resides is not included in the parameters section; therefore, when you go to look at the
  12.                 book, you get an error that "Cannot open input files."
  13.         07.27.93 v1.02
  14.              *  Fixed a problem with Express setup option (it wouldn't recognize a capital letter 'Y').  The express
  15.                 setup option will no longer echo the option you choose to the screen.
  16. */
  17. call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
  18. call SysLoadFuncs
  19.  
  20. /* Global Variable Declaration */
  21.         bootdrive = Substr(Value('PATH',,'OS2ENVIRONMENT'),Pos('\OS2\SYSTEM',Value('PATH',,'OS2ENVIRONMENT'))-2,2)
  22.         NADA=" is not an OS/2 on-line book"
  23.         VERSION='1.02'
  24.         VERSIONDATE='07.27.93'
  25. /* End of Global Variable Declaration */
  26.  
  27. call SysCls
  28. Title:
  29. Say
  30. Say "OS/2 Online Reference Manual Icon Creator - Version "VERSION
  31. Say "By Derek Berube "VERSIONDATE
  32.  
  33. ExpressYN:
  34. Say "Express Setup (Y/N) ?"
  35. Express=SysGetKey('NOECHO')
  36. Select
  37.    when Express="y" then Express="Y"
  38.    when Express="n" then Express="N"
  39.    when Express="Y" then Express="Y"
  40.    when Express="N" then Express="N"
  41. otherwise Signal ExpressYN
  42. end  /* select */
  43. Say
  44. Say "Searching the fixed disk for OS/2 Online reference manuals"
  45.  
  46. /* The following line searches the fixed disk for all .INF files and stores the path and filename
  47.  * information in the file matrix.  file.0 is a numerical value  giving the total number of elements
  48.  * in the array. */
  49. /****************************************/
  50. /* Get Drive Information                           */
  51. /* DriveInfo    - stem to store drive information */
  52. /* DriveInfo.0  - number of drives present        */
  53. /* DriveInfo.1..x - drive letters present           */
  54. /****************************************/
  55. /* Get the number of drives on the system */
  56.         Result=SysDriveMap()
  57.         DriveInfo.0=Trunc(length(Result)/3)+1
  58. do temp=1 to DriveInfo.0
  59.    X=pos(':',Result)                        /* Get position of end of 1st drive */
  60.    Y=length(Result)-X                     /* Get length from end of 1st drive to end of Result */
  61.    DriveInfo.temp=DELSTR(Result,x,y)    /* Assign drive letter to DriveInfo */
  62.    Result=DELSTR(Result,1,3)            /* Parse the Result variable */
  63. end /* end do */
  64.  
  65. do temp=1 to DriveInfo.0
  66.  call SysFileTree driveinfo.temp"\*.INF","file","FSO"
  67. /* Once all the files are found, the following procedure creates the icons in a folder called "MAKEBOOK.CMD - Find Results" */
  68. if file.0 >0 then
  69.  do  
  70.  Say "Making icons for online books found on drive "DriveInfo.temp"..."
  71.  rc=SysCreateObject("WPFolder","MAKEBOOK.CMD - Find Results","<WP_DESKTOP>","OBJECTID=<MAKEBOOK>;")
  72.     do i=1 to file.0
  73.       file.i=Translate(file.i)
  74.       BookName=SUBSTR(file.i,LASTPOS("\",file.i)+1)     /* This line strips the path from the OS/2 file.i string and stores thename of the INF in BookName */
  75. /* This section will assign names to know .INF files */
  76.       Select
  77.          when BookName="A3ALANOR.INF" then BookName="OS/2 LAN Online Reference (Administrator)"
  78.          when BookName="A3ALANCR.INF" then BookName="OS/2 LAN Online Reference (Commands)"
  79.          when BookName="BBSFILES.INF" then BookName="IBM NSC BBS Files Available for Download"
  80.          when BookName="BBSLIST.INF" then BookName="The IBM PCC Bulliten Board File Listing"
  81.          when BookName="BM2IPF.INF" then BookName="BM2IPF User's Guide"
  82.          when BookName="BMHLP03.INF" then BookName="BackMaster On-line Help"
  83.          when BookName="CMCMDREF.INF" then BookName="CM/2 Command Reference"
  84.          when BookName="CMDREF.INF" then BookName="OS/2 Command Reference"
  85.          when BookName="CMMSGREF.INF" then BookName="CM/2 Message Reference"
  86.          when BookName="CONTACT.INF" then BookName="Contact List for Help Desk"
  87.          when BookName="CYBERLNK.INF" then BookName="CyberLink"
  88.          when BookName="CYBERTIP.INF" then BookName="CyberTips"
  89.          when BookName="DBMSG.INF" then BookName="Database Manager Messages"
  90.          when BookName="DRM.INF" then BookName="DRM Technical and Warranty Support Plan"
  91.          when BookName="GAMMA.INF" then BookName="Gamma Tech Utilities"
  92.          when BookName="GG243730.INF" then BookName="OS/2 Redbook: Volume 1 Control Program"
  93.          when BookName="GG243731.INF" then BookName="OS/2 Redbook: Volume 2 DOS and Windows Settings"
  94.          when BookName="GG243732.INF" then BookName="OS/2 Redbook: Volume 3 PM and Workplace Shell"
  95.          when BookName="GG243774.INF" then BookName="OS/2 Redbook: Volume 4 Application Development"
  96.          when BookName="GUIREF20.INF" then BookName="Control Program Reference"
  97.          when BookName="HELPTIPS.INF" then BookName="HelpCenter Tips and Techniques"
  98.          when BookName="HLYGRAIL.INF" then BookName="Monty Python and The Holy Grail"
  99.          when BookName="HUMOR.INF" then BookName="Humor In Support"
  100.          when BookName="INEWS001.INF" then BookName="Idle News No.1 July 1991"
  101.          when BookName="IPF.INF" then BookName="Information Presentation Facility Sample"
  102.          when BookName="IPFC20.INF" then BookName="IPFC Reference"
  103.          when BookName="IPFCEXMP.INF" then BookName="IPFC Examples"
  104.          when BookName="KILLER4.INF" then BookName="Help for Killer4 Program (BUFFER)"
  105.          when BookName="LOADRAM2.INF" then BookName="LoadRAM User's Guide"
  106.          when BookName="MCIREXX.INF" then BookName="MultiMedia REXX"
  107.          when BookName="MEMORY.INF" then BookName="Blake Payne's Memory Management Handbook"
  108.          when BookName="NSCBOOKS.INF" then BookName="Technical Support Group On-Line Books"
  109.          when BookName="NSCDATA.INF" then BookName="NSC Database"
  110.          when BookName="NSCPROC.INF" then BookName="NSC Procedures Reference"
  111.          when BookName="OPSYSREF.INF" then BookName="Operating Systems Reference and Tutorial"
  112.          when BookName="OPSYSTRN.INF" then BookName="Operating Systems Training Manual"
  113.          when BookName="OS2TECHG.INF" then BookName="A Technical Guide to OS/2 2.0"
  114.          when BookName="OS2TNT.INF" then BookName="OS/2 Tips and Techniques"
  115.          when BookName="OVERVIEW.INF" then BookName="CM/2 Overview"
  116.          when BookName="PHONE.INF" then BookName="Phone List"
  117.          when BookName="PKZIP.INF" then BookName="PKZip Reference Manual"
  118.          when BookName="PMCOMM.INF" then BookName="PM Comm User's Guide"
  119.          when BookName="PMFUN.INF" then BookName="PM Reference"
  120.          when BookName="PMGPI.INF" then BookName="PM Reference: Graphics Functions"
  121.          when BookName="PMHOK.INF" then BookName="PM Reference: Graphics Orders"
  122.          when BookName="PMMSG.INF" then BookName="PM Reference: Message Processing"
  123.          when BookName="PMREL.INF" then BookName="PM Reference: Miscellaneous Reference"
  124.          when BookName="PMWIN.INF" then BookName="PM Reference: Window Functions"
  125.          when BookName="PMWKP.INF" then BookName="PM Reference: Workplace"
  126.          when BookName="PS2A_GEN.INF" then BookName="IBM PS General Assistant"
  127.          when BookName="PS2A_MKT.INF" then BookName="IBM PS Marketing Assistant"
  128.          when BookName="PS2A_SVC.INF" then BookName="IBM PS Service Assistant"
  129.          when BookName="PS2A_TEC.INF" then BookName="IBM PS Technical Assistant"
  130.          when BookName="PS1A_TSP.INF" then BookName="IBM PS Tech Specs Assistant #1"
  131.          when BookName="PS2A_TSP.INF" then BookName="IBM PS Tech Specs Assistant #2"
  132.          when BookName="PS2A_TTL.INF" then BookName="PS/2 Assistant"
  133.          when BookName="REXX.INF" then BookName="REXX Information"
  134.          when BookName="REXXAPI.INF" then BookName="REXX Program Reference"
  135.          when BookName="REXXEA.INF" then BookName="Extended Attribute functions for REXX"
  136.          when BookName="ROISTUB.INF" then BookName="OS/2 LAN Online Reference"
  137.          when BookNAme="SCENARIO.INF" then BookName="Call Scenario for Socrates Help Desk"
  138.          when BookName="SOM.INF" then BookName="System Object Model (SOM) Reference"
  139.          when BookName="TOOLINFO.INF" then BookName="Tools Reference"
  140.          when BookName="TRAPIPF.INF" then BookName="Trap Error Guide"
  141.          when BookName="TREKLIST.INF" then BookName="Star Trek: The Original Episodes"
  142.          when BookName="VREXX.INF" then BookName="Visual Rexx"
  143.          when BookName="WHYOS2.INF" then BookName="Why OS/2 2.0"
  144.       otherwise BookName=BookName
  145.       end  /* select */
  146.       Select
  147. /* The following lines are files that I know which are not OS/2 Online Books */
  148.          when BookName="APPS.INF" then BookName="APPS.INF"NADA
  149.          when BookName="CONTROL.INF" then Say "CONTROL.INF"NADA
  150.          when BookName="DRVMAP.INF" then Say "DRVMAP.INF"NADA
  151.          when BookName="INSTDOS.INF" then Say "INSTDOS.INF"NADA
  152.          when BookName="OEMSETUP.INF" then Say "OEMSETUP.INF"NADA
  153.          when BookName="OEM0.INF" then Say "OEM0.INF"NADA
  154.          when BookName="PMCONTRL.INF" then Say "PMCONTRL.INF"NADA
  155.          when BookName="PMSETUP.INF" then Say "PMSETUP.INF"NADA
  156.          when BookName="SETUP.INF" then Say "SETUP.INF"NADA
  157.          when BookName="TRIST100.INF" then Say "TRIST100.INF "NADA
  158.          when BookName="WWORD20.INF" then Say "WWORD20.INF is a Microsoft Word for Windows INF."
  159.       otherwise
  160.       do
  161.          If Express="Y" then rc=SysCreateObject("WPProgram",""BookName"","<MAKEBOOK>","EXENAME=VIEW.EXE;PARAMETERS="file.i";STARTUPDIR=\OS2\BOOK;")
  162.          else
  163.          do
  164.             Say
  165.             Say "Working with "BookName"."
  166.             Say "What do you want to call this book [ENTER keeps same name] ? "
  167.             PULL BookTitle
  168.             If BookTitle=" " then BookTitle=BookName
  169.             rc=SysCreateObject("WPProgram",""BookTitle"","<MAKEBOOK>","EXENAME=VIEW.EXE;PARAMETERS=DriveInfo.temp"file.i";STARTUPDIR=\OS2\BOOK;")
  170.          end /* do */
  171.       end /* do */
  172.       end /* select */
  173.     end /* do */
  174.  end /* do */
  175. else Say "No files found on drive "DriveInfo.temp" to set up! "
  176. end /* do - this one is overall loop for different drives found */
  177. Say
  178. Say "Je suis fini!"
  179.  
  180.