home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 32 Periodic / 32-Periodic.zip / viewedmi.zip / ViewEDMI.Cmd next >
OS/2 REXX Batch file  |  1995-11-16  |  5KB  |  99 lines

  1. /* ------------------------------------------------------------------------- */
  2. /* VIEWEDMI.CMD - View online EDMI issues                       Nov 16, 1995 */
  3. /* Written by Graham TerMarsch (gtermars@infomatch.com)                      */
  4. /* ------------------------------------------------------------------------- */
  5. /* This REXX script allows you to view all of the issues of EDMI that you    */
  6. /* have in a given directory at one time.  I wrote this because I found that */
  7. /* there were several occaisions when I wanted to perform a search through   */
  8. /* only the EDMI issues that I've got here and not any of my other online    */
  9. /* help.  So, I wrote this little script to start up a session with all of   */
  10. /* the issues in it.  Enjoy!                                                 */
  11. /* ------------------------------------------------------------------------- */
  12. /* For this script to work, it is assumed that the path that contains all of */
  13. /* your EDMI issues is listed in the HELP variable.                          */
  14. /* ------------------------------------------------------------------------- */
  15. /* If you have any problems with this software or would like to contact the  */
  16. /* author, he can be e-mailed at gtermars@infomatch.com.  To keep up to date */
  17. /* on this and other software by this author, point your WebExplorer over to */
  18. /* http://www.infomatch.com/~gtermars.                                       */
  19. /* ------------------------------------------------------------------------- */
  20.  
  21. /* ------------------------------------------------------------------------- */
  22. /* Variables:                                                                */
  23. /*                                                                           */
  24. /* EDMIPATH     Full path to where you store your EDMI issues.  If this path */
  25. /*              is NOT in your HELP listing in your CONFIG.SYS file you will */
  26. /*              have trouble                                                 */
  27. /* EDMI         Array which will be declared later but will contain all of   */
  28. /*              the filenames of the available EDMI issues.                  */
  29. /* ISSUES       String containing all of the filenames for the EDMI issues;  */
  30. /*              will be used to start the OS/2 help viewer.                  */
  31. /* I            Index into array of available issues.                        */
  32. /* ------------------------------------------------------------------------- */
  33. ISSUES = ''
  34. I = 1
  35.  
  36. /* ------------------------------------------------------------------------- */
  37. /* Parse the given command line argument.  If none exists, display usage     */
  38. /* message and quit.                                                         */
  39. /* ------------------------------------------------------------------------- */
  40. PARSE ARG EDMIPATH
  41. IF (EDMIPATH = '') THEN DO
  42.         say 'ViewEDMI.Cmd'
  43.         say 'Written by Graham TerMarsch (gtermars@infomatch.com)'
  44.         say ''
  45.         say 'Views all EDMI issues in a given directory.'
  46.         say ''
  47.         say 'Usage:     ViewEDMI <path>'
  48.         exit
  49. END
  50.  
  51. IF (SUBSTR(EDMIPATH, LENGTH(EDMIPATH), 1) <> '\') THEN DO
  52.         EDMIPATH = INSERT( '\', EDMIPATH, LENGTH(EDMIPATH) )
  53. END
  54.  
  55. /* ------------------------------------------------------------------------- */
  56. /* Load any necessary REXX functions.                                        */
  57. /* ------------------------------------------------------------------------- */
  58. call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
  59. call RxFuncAdd "SysDropFuncs", "RexxUtil", "SysDropFuncs"
  60. call SysLoadFuncs
  61.  
  62. /* ------------------------------------------------------------------------- */
  63. /* Generate a listing of all of the EDMI issues in that directory into the   */
  64. /* EDMI array.  If no issues are available, display a message and quit.      */
  65. /* ------------------------------------------------------------------------- */
  66. call SysFileTree EDMIPATH'EDMI*.Inf', 'EDMI', 'O'
  67.  
  68. IF (EDMI.0 = 0) THEN DO
  69.         say 'No issues of EDMI are available in the "'EDMIPATH'" directory.'
  70.         exit
  71. END
  72.  
  73. /* ------------------------------------------------------------------------- */
  74. /* Create a string holding the filenames of all of the issues.               */
  75. /* ------------------------------------------------------------------------- */
  76. DO UNTIL (I >= EDMI.0)
  77.         IF (I > 1) THEN DO
  78.                 ISSUES = INSERT( '+', ISSUES, LENGTH(ISSUES) )
  79.         END
  80.  
  81.         ISSUES = INSERT( EDMI.I, ISSUES, LENGTH(ISSUES) )
  82.  
  83.         I = I + 1
  84. END
  85.  
  86. /* ------------------------------------------------------------------------- */
  87. /* Start the OS/2 help viewer.  Being that I expect the command line to be   */
  88. /* quite long, we'll cheat here and set an environment variable, start the   */
  89. /* help viewer, and then reset the environment variable.                     */
  90. /* ------------------------------------------------------------------------- */
  91. '@SET ALLEDMIISSUES=' || ISSUES
  92. '@start VIEW ALLEDMIISSUES'
  93. '@SET ALLEDMIISSUES='
  94.  
  95. /* ------------------------------------------------------------------------- */
  96. /* Cleanup.                                                                  */
  97. /* ------------------------------------------------------------------------- */
  98. call SysDropFuncs
  99.