home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pds.zip / REMOVE.CMD < prev    next >
OS/2 REXX Batch file  |  1994-06-22  |  5KB  |  215 lines

  1. /*REXX*/
  2.  
  3.   /***
  4.   signal on HALT    name HaltExit
  5.   signal on ERROR   name ErrorExit
  6.   signal on FAILURE name FailureExit
  7.   signal on SYNTAX  name SyntaxExit
  8.   ***/
  9.  
  10. main:
  11. parse arg p1
  12.   sGlobal.fDebug  = 'N'
  13.   fDebugQ  = sGlobal.fDebug
  14.   fDispStax= 'N'
  15.   fDispHelp= 'N'
  16.  
  17.   CALL rParseParms p1
  18.  
  19.   if fDebugQ = 'Y' then
  20.    do
  21.     trace ?r
  22.    end
  23.  
  24.   if fDispStax = 'Y' then
  25.    do
  26.     CALL rDispSyntax 0, 0
  27.    end
  28.  
  29.   if fDispHelp = 'Y' then
  30.    do
  31.     CALL rDispSyntax 1, 0
  32.    end
  33.  
  34.   /* Actual routine */
  35.   rc   = rLoadFuncs('SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs')
  36.   if rc <> 0 then
  37.    do
  38.     Call rSiren 1, 1
  39.     say 'REMOVE - Unable to initialize the "REXXUTIL" subsystem'
  40.     exit 8
  41.    end
  42.  
  43.   testrc = rTestRXPD()
  44.  
  45.   sysinirc = SysIni('USER','HSS.PDS','DELETE:')
  46.  
  47.   say ''
  48.   say 'The PDS package has been removed from the OS/2 system files.'
  49.   say ''
  50.   say 'The removal of the rest of the "Panel Display System" requires that'
  51.   say 'the "HSSPD.DLL" library be deleted. How it is deleted is dependent'
  52.   say 'upon how it was installed. If this library was copied from the PDS'
  53.   say 'installation directory then delete the library from the directory which'
  54.   say 'contains the copy.'
  55.   say ''
  56.   say 'If this library was installed by adding the PDS installation directory'
  57.   say 'to the LIBPATH statement in CONFIG.SYS, then remove the installation'
  58.   say 'directory from that statement.'
  59.   say ''
  60.   say 'If the PDS installation directory was added to the DPATH statement in'
  61.   say 'CONFIG.SYS then simply remove it from that statement.'
  62.   say ''
  63.   say 'If any REXX PDS sample script has been executed or if any PDS program'
  64.   say 'is currently executing since this OS/2 system was last IPLed, then it'
  65.   say 'may be necessary to reIPL this system in order to delete the "HSSPD.DLL"'
  66.   say 'library and installation directory.'
  67.   if testrc = 0 then
  68.    do
  69.   say ''
  70.   say 'Tests indicate that a REXX PDS script was/is executing.'
  71.    end
  72.   else
  73.    do
  74.   say ''
  75.   say 'Tests indicate that a REXX PDS script has not been executed and it'
  76.   say 'should be possible to delete the PDS library an installation directory.'
  77.    end
  78.   say ''
  79.  
  80.   exit 0
  81.  
  82. HaltExit:
  83.   Call BEEP 882, 40
  84.   Call BEEP 882, 40
  85.   say 'REMOVE processing halted by request;'
  86.   exit 0
  87.  
  88. ErrorExit:
  89.   Call BEEP 882, 40
  90.   Call BEEP 882, 40
  91.   say 'REMOVE processing failed due to unknown error;'
  92.   exit 24
  93.  
  94. FailureExit:
  95.   Call BEEP 882, 40
  96.   Call BEEP 882, 40
  97.   say 'REMOVE processing failed due to unknown failure;'
  98.   exit 32
  99.  
  100. SyntaxExit:
  101.   Call BEEP 882, 40
  102.   Call BEEP 882, 40
  103.   say 'REMOVE processing failed due to syntax error;'
  104.   exit 64
  105.  
  106. rParseParms:
  107. parse arg p1
  108.  
  109.   do Forever
  110.    w1 = word(p1,1)
  111.    parse var w1 with "/" f1 ":" v1
  112.    select
  113.     when (w1 = '') then
  114.      do
  115.       return 0
  116.      end
  117.     when TRANSLATE(w1) = '/DEBUG' then
  118.      do
  119.       fDebugQ='Y'
  120.       p1 = SUBWORD(p1,2)
  121.      end
  122.     when TRANSLATE(f1) = 'D' then
  123.      do
  124.       fDebugQ = TRANSLATE(v1)
  125.       p1 = SUBWORD(p1,2)
  126.      end
  127.     when TRANSLATE(f1) = '?' then
  128.      do
  129.       fDispStax='Y'
  130.       fDispHelp='N'
  131.       p1 = SUBWORD(p1,2)
  132.      end
  133.     when TRANSLATE(f1) = 'H' then
  134.      do
  135.       fDispStax='N'
  136.       fDispHelp='Y'
  137.       p1 = SUBWORD(p1,2)
  138.      end
  139.     otherwise
  140.      do
  141.       select
  142.        when TRUE = FALSE then
  143.         do
  144.         end
  145.        otherwise
  146.         do
  147.          Call rSiren 8, 1
  148.          say 'REMOVE - Too many parms specified; Parm "'w1'" unknown;'
  149.          CALL rDispSyntax 0 8
  150.         end
  151.       end /*select*/
  152.      end
  153.    end
  154.   end
  155.  
  156.   return 0
  157.  
  158. rDispSyntax: Procedure
  159. parse upper arg iHelp iExit
  160.  
  161.   say ' Syntax  : REMOVE '
  162.   say '           REMOVE {/?|/h}'
  163.   if iHelp > 0 then
  164.    do
  165.     CALL rDispHelp
  166.    end
  167.  
  168.   exit iExit
  169.  
  170. rDispHelp: Procedure
  171.  
  172.   say ' Parms   : *N/A*      - No parms apply.'
  173.   say ''
  174.   say ' Options : /?         - Display command syntax.'
  175.   say '           /h         - Display this help info.'
  176.   say ' Examples:'
  177.   say '    REMOVE /h'
  178.   say ' '
  179.   say '    REMOVE'
  180.  
  181.   return ''
  182.  
  183. /* rSiren: does the siren bit by running the scale based upon a       */
  184. /*    frequency specified by the caller.                              */
  185. rSiren: Procedure
  186.    Parse Arg freq, cycle
  187.    note.1 = 262 * freq /* middle C */
  188.    note.2 = 294 * freq /* D */
  189.    note.3 = 330 * freq /* E */
  190.    note.4 = 349 * freq /* F */
  191.    note.5 = 392 * freq /* G */
  192.    note.6 = 440 * freq /* A */
  193.    note.7 = 494 * freq /* B */
  194.    note.8 = 524 * freq /* C */
  195.    do j = 1 to cycle
  196.     call beep note.8,250 /* hold each note for a 1/4 second */
  197.     call beep note.1,250 /* hold each note for a 1/4 second */
  198.    end j
  199.    Return
  200.  
  201. rLoadFuncs:
  202. parse arg sREP, sDll, sRtn
  203.   rxrc = RxFuncAdd(sREP, sDll, sRtn)
  204.   signal on syntax name xTrapFuncs
  205.   interpret 'Call 'sRtn
  206.   return 0
  207.  
  208. rTestRXPD:
  209.   signal on syntax name xTrapFuncs
  210.   CALL rxPDZVarDefine 'ZENTER'
  211.   return 0
  212.  
  213. xTrapFuncs:
  214.   return 127
  215.