home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / dongrovs.zip / RexxUtil_REQ.cmd < prev    next >
OS/2 REXX Batch file  |  1996-10-16  |  2KB  |  56 lines

  1. /* ********************************************************************* */
  2. /* ********************************************************************* */
  3. /* Normally used as a REQUIRES file, but all possiblities are handled.   */
  4. /* ********************************************************************* */
  5. parse source . a2 .
  6. atRc= 0
  7. SELECT
  8.   WHEN a2 == 'FUNCTION'
  9.   THEN atRc = ''
  10.   WHEN a2 == 'COMMAND'
  11.   THEN SAY 'RexxUtil.DLL has been Loaded or was already Loaded....'
  12.   OTHERWISE NOP  /* SUBROUTINE and/or REQUIRES */
  13. END
  14. return atRc
  15.  
  16. /* ******************************************************************* */
  17. /* ******************************************************************* */
  18. /*  Any REQUIRES files */
  19. /* ** None are REQUIRED ** */
  20. /* ******************************************************************* */
  21. /* ******************************************************************* */
  22.  
  23.   /* The following is the proper way to check for and load REXXUTIL!! */
  24.   /* And the following use of 'SysDropFuncs' is the only use without a */
  25.   /* direct COMMAND from the system operator. */
  26. ::routine LoadDLLs
  27.   IF RxFuncQuery('SysDropFuncs')
  28.   THEN DO;
  29.     /* Note: The double test is because some Operators Undefine the above function. */
  30.     IF RxFuncQuery('SysLoadFuncs')
  31.     THEN DO;
  32.       call RxFuncAdd  'SysLoadFuncs',  'RexxUtil',  'SysLoadFuncs';
  33.       call SysLoadFuncs;
  34.     END;
  35.   END;
  36. RETURN .TRUE
  37.  
  38. ::class RexxUtil_REQ
  39. ::method INIT CLASS
  40.   expose Dummy
  41.   Dummy = LoadDLLs()
  42. ::method UNINIT CLASS
  43.   expose Dummy
  44.   NOP
  45. /* ------------------------------------------------------------------------ */
  46. /* The UNINIT has nothing to do because it's never safe to Automacticly     */
  47. /* unload REXXUTIL.DLL.                                                     */
  48. /* Calling "SysDropFuncs" doesn't just unload it the session that called it */
  49. /* but ALL SESIONS.                                                         */
  50. /* And it cannot be reloaded again until ALL REXX using sessions terminate. */
  51. /* ------------------------------------------------------------------------ */
  52.  
  53. /* ******************************************************************* */
  54. /* ****************** End of RexxUtil_REQ.cmd ************************ */
  55. /* ******************************************************************* */
  56.