home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / lsmt213c.zip / rglsrxut.cmd < prev    next >
OS/2 REXX Batch file  |  2000-02-15  |  4KB  |  104 lines

  1. /*---------------------------------------------------------------------------*\
  2. |  Register all the LSRXUT.DLL Functions      (C) Alain Rykaert - DEC95-OCT96 |
  3. |                                                                 FEB2000     |
  4. \*---------------------------------------------------------------------------*/
  5.  
  6.     Parse Upper Arg Option .
  7.  
  8.     Call ChkDll                                    /* Check for correct DLL*/
  9.  
  10.     If Strip(Translate(Option)) = '/M'
  11.       Then Mute = 1
  12.       Else Mute = 0
  13.  
  14.     Result_Query = RxFuncQuery('LoadLSRXUTFuncs')
  15.     If Result_Query = 0
  16.       Then Do
  17.              If \Mute Then Say '*** OK, LSRXUT was registered. ***'
  18.            End
  19.       Else Do
  20.              Result_Add = RxFuncAdd('LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs')
  21.              If Result_Add = 0
  22.                Then Do
  23.                       If \MUTE Then Say '*** OK, LSRXUT is registered. ***'
  24.                       Signal On Syntax Name Load_Check
  25.                       Call LoadLsRxutFuncs
  26.                       Load_Check:        /* RC of 43 means LSRXUT not found*/
  27.                       If RC = 43
  28.                         Then Do
  29.                                Say '*** ERROR: Not able to load the LSRXUT. '
  30.                                Say '    Perhaps REXX not installed'
  31.                                say '    or LSRXUT.DLL not found in a LIBPATH drive/directory.'
  32.                               '@Pause'
  33.                              End
  34.                         Else Nop
  35.                       Signal Off Syntax
  36.                     End
  37.                Else Do
  38.                       Say '*** ERROR: LSRXUT registration has failed. ***'
  39.                      '@Pause'
  40.                     End
  41.            End
  42.  
  43.     Call RxFuncAdd 'WfrxLoadFuncs', 'WfrxUtil', 'WfrxLoadFuncs'
  44.     Call WfrxLoadFuncs
  45.  
  46.     If \Mute Then Say '0A0D'X ' LSRXUT.DLL Version' LsRxUtVer()
  47.  
  48.     Exit
  49.  
  50.  CHKDLL:/* ------------------------------------------------------------------*/
  51.  
  52.     LsrDrive = Left(SysSearchPath('PATH', 'NET.EXE'), 2)    /* IBMLAN Drive*/
  53.  
  54.     If LsrDrive = ''
  55.       Then Do
  56.              Say ' Unable to determine the OS/2 Boot Drive'
  57.              Say ' or the OS/2 Lan Requester Drive.'
  58.              Exit
  59.            End
  60.  
  61.     REQ_CSD = SubStr(LineIn(LsrDrive'\ibmlan\syslevel.req'),48,1)
  62.     Call Stream lsrdrive'\ibmlan\syslevel.req', 'C', 'Close'
  63.  
  64.     If REQ_CSD = '7'
  65.       Then Call Compit 'lsrxut.30' LsrDrive'\ibmlan\netlib\lsrxut.dll'
  66.       Else Call Compit 'lsrxut.40' LsrDrive'\ibmlan\netlib\lsrxut.dll'
  67.  
  68.     Call Compit 'wfrxutil.dll' LsrDrive'\ibmlan\netlib\wfrxutil.dll'
  69.  
  70.     Return
  71.  
  72.  COMPIT:/* ------------------------------------------------------------------*/
  73.  
  74.     Parse Arg Source Target
  75.  
  76.     If Source = '' | Target = ''
  77.       Then Do
  78.              Call Beep 500,200
  79.              Return
  80.            End
  81.  
  82.     Q1 = Stream(Source, 'C', 'Query Exists')
  83.     If Q1 <> ''
  84.       Then Do
  85.              Q1 = Stream(Source, 'C', 'Query DateTime')
  86.              Q2 = Stream(Target, 'C', 'Query DateTime')
  87.              If Q1 \= Q2
  88.                Then Do
  89.                      '@copy' Source Target
  90.                       If RC <> 0
  91.                         Then Do
  92.                                Call Beep 500,200
  93.                                Say ' Copy Error :' RC
  94.                                Exit
  95.                              End
  96.                         Else Nop
  97.                     End
  98.                Else Nop
  99.           End
  100.       Else Nop
  101.  
  102.     Return
  103.  
  104.