home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tsrvr.zip / GETTIME.CMD next >
OS/2 REXX Batch file  |  1995-06-14  |  595b  |  32 lines

  1. /*  gettime.cmd 1995-05-06 mjb  */
  2.  
  3.     call setlocal
  4.  
  5.     srvpnm = '\pipe\time'
  6.  
  7.     call charout , 'Getting time from server at' srvpnm '... '
  8.  
  9.     call lineout srvpnm, 'time'
  10.  
  11.     l = linein(srvpnm)
  12.     if l = '' then do
  13.         call lineout , 'failed - no response from server'
  14.         call endlocal
  15.         return 10
  16.         end
  17.  
  18.     parse value l with rc t
  19.     if rc <> 'OK' then do
  20.         call lineout , 'failed - rc is' rc
  21.         call endlocal
  22.         return 10
  23.         end
  24.  
  25.     call lineout , t
  26.  
  27.     call lineout srvpnm
  28.  
  29.     call endlocal
  30.  
  31.     return 0
  32.