home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pds.zip / IVP.CMD < prev    next >
OS/2 REXX Batch file  |  1994-06-19  |  6KB  |  244 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('rxPDLoadFuncs', 'HSSPD', 'rxPDLoadFuncs')
  36.   if rc <> 0 then
  37.    do
  38.     Call rSiren 1, 1
  39.     say 'IVP - Unable to define and initialize the "RXPD" subsystem to REXX'
  40.     say '      Verify that HSSPD.DLL is in a directory listed in the'
  41.     say '      "LIBPATH" statement in the "CONFIG.SYS".'
  42.     exit 8
  43.    end
  44.  
  45.   sGlobal.fDebug  = fDebugQ
  46.  
  47.   sGlobal.zBid = rInitPDS()
  48.   if sGlobal.zBid = -1 then
  49.    do
  50.     Call rSiren 2, 3
  51.     say 'IVP - Unable to initialize an instance of the "RXPD" subsystem'
  52.     say '      for this "Installation and Verification Procedure".'
  53.     say '      "RXPD" subsystem was defined but the IVP was unable to'
  54.     say '      execute the "rxPDInit" routine. Possibly a conflict with'
  55.     say '      another REXX extension package.'
  56.     exit 8
  57.    end
  58.   if sGlobal.zBid = x2c(00000000) then
  59.    do
  60.     Call rSiren 2, 3
  61.     say 'IVP - Unable to initialize an instance of the "RXPD" subsystem'
  62.     say '      for this "Installation and Verification Procedure".'
  63.     say '      Verify that IVP.PNL is in a directory listed in the'
  64.     say '      "DPATH" statement in the "CONFIG.SYS".'
  65.     exit 8
  66.    end
  67.  
  68.   Call rxPDZVarDefine
  69.  
  70.   if SYMBOL('ZVERSION') = 'LIT' then
  71.    do
  72.     Call rSiren 1, 1
  73.     ZVERSION = 1
  74.     ZRELEASE = 3
  75.     ZPRODUCT = 'Panel Display System V1.05'
  76.     ZCOPYRIGHT = 'All Rights Reserved; '
  77.     ZCOPYRIGHT = ZCOPYRIGHT||' Copyright (c) 1994, Rick W. Hodgson'
  78.    end
  79.  
  80.   sZVERSION = ZVERSION
  81.   sZRELEASE = ZRELEASE
  82.   sZPRODUCT = ZPRODUCT
  83.   sZCOPYRIGHT = ZCOPYRIGHT
  84.  
  85.   akey = rxPDDisplay(sGlobal.zBid,'PANEL000')
  86.   do while 0 = rDoDisplay(sGlobal.zBid)
  87.   end /* do while 0 = rDoDisplay() */
  88.  
  89.   rc = rxPDTerm(sGlobal.zBid)
  90.  
  91.   exit 0
  92.  
  93. /**********************************************************************\
  94.  rDoDisplay:
  95.   This routine displays the panel which shows:
  96.          Product, Version, Release and Copyright
  97. \**********************************************************************/
  98. rDoDisplay:
  99. parse arg sGlobal.zBid
  100.  
  101.   akey = 0
  102.  
  103.   do while akey <> ZESC
  104.    akey = rxPDDisplay(sGlobal.zBid, 'PANEL001')
  105.   end /*do while akey <> ZESC*/
  106.  
  107.   return 8;
  108.  
  109. HaltExit:
  110.   Call BEEP 882, 40
  111.   Call BEEP 882, 40
  112.   say 'IVP processing halted by request;'
  113.   exit 0
  114.  
  115. ErrorExit:
  116.   Call BEEP 882, 40
  117.   Call BEEP 882, 40
  118.   say 'IVP processing failed due to unknown error;'
  119.   exit 24
  120.  
  121. FailureExit:
  122.   Call BEEP 882, 40
  123.   Call BEEP 882, 40
  124.   say 'IVP processing failed due to unknown failure;'
  125.   exit 32
  126.  
  127. SyntaxExit:
  128.   Call BEEP 882, 40
  129.   Call BEEP 882, 40
  130.   say 'IVP processing failed due to syntax error;'
  131.   exit 64
  132.  
  133. rParseParms:
  134. parse arg p1
  135.  
  136.   do Forever
  137.    w1 = word(p1,1)
  138.    parse var w1 with "/" f1 ":" v1
  139.    select
  140.     when (w1 = '') then
  141.      do
  142.       return 0
  143.      end
  144.     when TRANSLATE(w1) = '/DEBUG' then
  145.      do
  146.       fDebugQ='Y'
  147.       p1 = SUBWORD(p1,2)
  148.      end
  149.     when TRANSLATE(f1) = 'D' then
  150.      do
  151.       fDebugQ = TRANSLATE(v1)
  152.       p1 = SUBWORD(p1,2)
  153.      end
  154.     when TRANSLATE(f1) = '?' then
  155.      do
  156.       fDispStax='Y'
  157.       fDispHelp='N'
  158.       p1 = SUBWORD(p1,2)
  159.      end
  160.     when TRANSLATE(f1) = 'H' then
  161.      do
  162.       fDispStax='N'
  163.       fDispHelp='Y'
  164.       p1 = SUBWORD(p1,2)
  165.      end
  166.     otherwise
  167.      do
  168.       select
  169.        when fFlSpecQ <> 'Y' then
  170.         do
  171.          fFlSpecQ = 'Y'
  172.          sFlSpec = w1
  173.          p1 = SUBWORD(p1,2)
  174.         end
  175.        otherwise
  176.         do
  177.          Call rSiren 8, 1
  178.          say 'IVP - Too many parms specified; Parm "'w1'" unknown;'
  179.          CALL rDispSyntax 0 8
  180.         end
  181.       end /*select*/
  182.      end
  183.    end
  184.   end
  185.  
  186.   return 0
  187.  
  188. rDispSyntax: Procedure
  189. parse upper arg iHelp iExit
  190.  
  191.   say ' Syntax  : IVP '
  192.   say '           IVP {/?|/h}'
  193.   if iHelp > 0 then
  194.    do
  195.     CALL rDispHelp
  196.    end
  197.  
  198.   exit iExit
  199.  
  200. rDispHelp: Procedure
  201.  
  202.   say ' Options : /?         - Display command syntax.'
  203.   say '           /h         - Display this help info.'
  204.   say ' Examples:'
  205.   say '    IVP /h'
  206.  
  207.   return ''
  208.  
  209. /* rSiren: does the siren bit by running the scale based upon a       */
  210. /*    frequency specified by the caller.                              */
  211. rSiren: Procedure
  212.    Parse Arg freq, cycle
  213.    note.1 = 262 * freq /* middle C */
  214.    note.2 = 294 * freq /* D */
  215.    note.3 = 330 * freq /* E */
  216.    note.4 = 349 * freq /* F */
  217.    note.5 = 392 * freq /* G */
  218.    note.6 = 440 * freq /* A */
  219.    note.7 = 494 * freq /* B */
  220.    note.8 = 524 * freq /* C */
  221.    do j = 1 to cycle
  222.     call beep note.8,250 /* hold each note for a 1/4 second */
  223.     call beep note.1,250 /* hold each note for a 1/4 second */
  224.    end j
  225.    Return
  226.  
  227. rLoadFuncs:
  228. parse arg sREP, sDll, sRtn
  229.   rxrc = RxFuncAdd(sREP, sDll, sRtn)
  230.   signal on syntax name xLoadFuncs
  231.   interpret 'Call 'sRtn
  232.   return 0
  233.  
  234. xLoadFuncs:
  235.   return 127
  236.  
  237. rInitPDS:
  238.   signal on syntax name xInitPDS
  239.   bid = rxPDInit('IVP','GREENHI','YELLOWHI','LBLUEHI',,25,80)
  240.   return bid
  241.  
  242. xInitPDS:
  243.   return -1
  244.