home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxapfd.zip / rc4.cmd < prev    next >
OS/2 REXX Batch file  |  1993-10-16  |  1KB  |  45 lines

  1. /* Rexx */
  2.  
  3. /* Read from a pipe and send it out over APPC */
  4. logfile = 'c:\rc4.log'
  5. convtype = 'mfn'       /* mapped, full-duplex, non-blocking */
  6.  
  7. signal on syntax
  8.  
  9. Parse Arg partlu, partmode, hread, hwrite, tpid, convid
  10.  
  11. call rxsi2h hread
  12. Do Forever
  13.   line = linein()
  14.   If line = '' Then
  15.     line = ' '
  16.   appcrc = rxappc('Send_Data',convtype,tpid,convid,'n',Cryption(line),'inf.')
  17.   If appcrc <> 0 Then
  18.     Do
  19.     Say 'Send_Data failed with rc =' appcrc
  20.     Call rxAppc 'Tp_Ended', tpid,'s'
  21.     Exit
  22.     End
  23.   appcrc = rxappc('Flush',convtype,tpid,convid,)
  24.   If appcrc <> 0 Then
  25.     Do
  26.     Say 'Flush failed with rc =' appcrc
  27.     Call Appc 'Tp_Ended', tpid,'s'
  28.     Exit
  29.     End
  30. End
  31.  
  32. call rxdestroypipe hread, hwrite
  33. Call rxappc 'Deallocate', convtype, tpid, convid, 's','inf.'
  34. Call rxAppc 'Tp_Ended', tpid,'s'
  35.  
  36. Exit
  37.  
  38. Syntax:
  39. call lineout logfile,'Syntax error in line' sigl':',sourceline(sigl)
  40. call lineout logfile,'Failed with syntax error ('rc')' ErrorText(rc)
  41. exit
  42.  
  43. Cryption:
  44. Return BitXor(Arg(1),Copies('ff'x,Length(Arg(1))))
  45.