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

  1. /* Rexx */
  2.  
  3. Signal On Syntax
  4.  
  5. Parse Arg pq
  6.  
  7. /* Route incoming data from APPC into a PmPrintf window */
  8.  
  9. appcrc=Appc('Receive_Allocate','REMCMDC2','Inf.')
  10. If appcrc = 0 Then
  11.   Do
  12.   tpid =   inf.0
  13.   convid = inf.1
  14.   incoming_user = inf.4
  15.   End
  16. Else
  17.   Do
  18.   call rxpmprintf pq,'Receive_Allocate failed with rc =' xlatrxap(appcrc)
  19.   Exit
  20.   End
  21. appcrc = Appc('Receive_Wait', tpid, convid, 'Mapped', 'Inf.', 10000)
  22. If appcrc <> 0 Then
  23.   Do
  24.   call rxpmprintf pq,'Receive_Wait failed with rc='xlatrxap(appcrc)'.'
  25.   If appcrc = '0E00'x Then
  26.     call rxpmprintf pq,'(Security check failed at' partlu')'
  27.   Call Appc 'Tp_Ended', tpid
  28.   Exit
  29.   End
  30.  
  31. Do While appcrc = 0 & inf.0 <> 1
  32.   inf.2 = Cryption(inf.2)
  33.   call rxpmprintf pq,inf.2
  34.   appcrc = Appc('Receive_Wait', tpid, convid, 'Mapped', 'Inf.', 10000)
  35. End
  36.  
  37. Return
  38.  
  39. Cryption:
  40. Return BitXor(Arg(1),Copies('ff'x,Length(Arg(1))))
  41.  
  42. Syntax:
  43. Call rxpmprintf pq,ErrorText(rc)'0d0a'x||sourceline(sigl),'Rexx Syntax Error at line' sigl
  44. Exit
  45.