home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netdor3.zip / DISK_13 / IMAGE12.ZIP / CATALOG / WPSNOARG.CMD < prev   
OS/2 REXX Batch file  |  1993-09-24  |  4KB  |  119 lines

  1. /*****************************************************************************
  2.  *                            IBM NetDoor Catalog                            *
  3.  *        Generalized Backend to Add percent (%) to Parameter String         *
  4.  *                     CORE Development (CORE at WATSON)                     *
  5.  *****************************************************************************
  6.  *                    Licensed Materials-Property of IBM                     *
  7.  *               5604-472 (c) Copyright IBM Corporation, 1993                *
  8.  *                           All rights reserved.                            *
  9.  *                  US Government Users Restricted Rights -                  *
  10.  *                 Use, duplication or disclosure restricted                 *
  11.  *                by GSA ADP Schedule Contract with IBM Corp.                *
  12.  *****************************************************************************/
  13. trace 'O'
  14. signal on syntax
  15. signal on novalue
  16. call on halt
  17. call rxfuncadd 'CADDINIT', 'RXCADD', 'CADDINIT'
  18. Ver = 'CAddInit'()
  19. if abbrev(Ver, 'ERROR:')
  20.   then exit 200
  21. Title = RxCAdd.STitle 'Installation'
  22. XCode = 0
  23. if 'REGFUNC'('COUENV') <> 0
  24.   then call AddExit 206, 'Error registering COUENV.DLL.'
  25. if 'REGFUNC'('RXUTILS') <> 0
  26.   then call AddExit 206, 'Error registering RXUTILS.DLL.'
  27.  
  28. select
  29.   when RxCAdd.OpType = 'ADD'
  30.     then do
  31.       if rxOs2Ver() >= 2.0
  32.         then RXCADD.PROGINFO.5 = '%' RXCADD.PROGINFO.5
  33.     end
  34.   when RxCAdd.OpType = 'REMOVE'
  35.     then do
  36.     end
  37.   otherwise do
  38.     call 'MessageBox' Title, 'Unexpected operation type "'RxCAdd.OpType'"'
  39.     XCode = 201
  40.   end
  41. end
  42.  
  43. call AddExit XCode
  44.  
  45. RunItl: procedure expose RXCADD. Title
  46. parse arg ItlName
  47. CDr = rxCouInfo('GET', 'REMOTE')
  48. List = 'VERSION STITLE OPTYPE PREVIOUS'
  49. do I = 1 to words(List)
  50.   Name = 'RXCADD.'word(List, I)
  51.   call value Name, value(Name), 'OS2ENVIRONMENT'
  52. end I
  53. do I = 1 to RXCADD.PROGINFO.0
  54.   call value 'RXCADD.PROGINFO.'I, RXCADD.PROGINFO.I, 'OS2ENVIRONMENT'
  55. end I
  56. if pos('\', ItlName) = 0
  57.   then do
  58.     parse source . . Me
  59.     ItlName = left(Me, lastpos('\', Me))||ItlName
  60.   end
  61. '@CALL' CDr'IMPIT.CMD /R:'ItlName '/NOPAUSE'
  62. if rc <> 0
  63.   then call AddExit 205, 'Error' rc 'returned by ITL interpreter.'
  64. return rc
  65.  
  66. AddExit:
  67. parse arg XCode, Msg
  68. if XCode = ''
  69.   then XCode = 0
  70. if Msg <> ''
  71.   then call 'MessageBox' Title, Msg
  72. call 'CAddComplete' XCode
  73. call 'CAddExit'
  74. exit XCode
  75.  
  76. /***********************************************************************
  77.  *                             ERROR TRAPS                             *
  78.  ***********************************************************************/
  79. BugInit:
  80. signal off error; signal off failure; signal off halt
  81. signal off novalue; signal off notready; signal off syntax
  82. parse upper source . . Me
  83. if symbol('TITLE') = 'LIT'
  84.   then Title = 'COREADD Failure'
  85. Me = Me':'||'0A'x
  86. if symbol('GLOBALS') = 'LIT'
  87.   then do
  88.     Globals = 'TrVal'
  89.     TrVal = 'O'
  90.   end
  91. return
  92.  
  93. Halt:
  94. Where = SigL
  95. call BugInit
  96. call 'MessageBox' Title, Me||'Execution halted by user in line' Where
  97. XXC = 204
  98. signal DebugExit
  99.  
  100. Syntax:
  101. Where = SigL
  102. call BugInit
  103. call 'MessageBox' Title,,
  104.     Me||'Syntax error' rc '('errortext(rc)') in line' Where'.'
  105. XXC = 203
  106. signal DebugExit
  107.  
  108. Novalue:
  109. Where = SigL
  110. call BugInit
  111. call 'MessageBox' Title, Me||'NOVALUE error ('condition('D')') in line' Where'.'
  112. XXC = 203
  113. signal DebugExit
  114.  
  115. DebugExit:
  116. call 'CAddComplete' XXC
  117. call 'CAddExit'
  118. exit XXC
  119.