home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
remcmd.zip
/
REMCMDC4.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-05-10
|
2KB
|
64 lines
/* Rexx */
/* Read from a pipe and send it out over APPC */
Parse Arg partlu, partmode, hread, hwrite
appcrc = Appc('Tp_Started', , 'REMCMDC4', 'inf.')
If appcrc <> 0 Then
Do
Say 'Tp_Started failed with rc='xlatrxap(appcrc)'.'
Exit
End
tpid = inf.0
Signal On Syntax Name Trap_Allocate_Syntax
appcrc = Appc('Allocate',tpid,partlu,partmode,'REMCMDC2','Mapped',
, 'A','N','None','Inf.')
Signal Off Syntax
If appcrc <> 0 Then
Do
say 'Mc_Allocate failed with rc='xlatrxap(appcrc)
say 'Primary Rc ='c2x(inf.2);
say 'Secondary Rc='c2x(inf.3)
say 'Sense Code ='c2x(inf.4)
Call Appc 'Tp_Ended', tpid
Exit
End
convid = inf.1
call rxsi2h hread
Do Forever
line = linein()
If line = '' Then
line = ' '
appcrc = Appc('Send_Data', tpid, convid, 'Mapped', cryption(line))
If appcrc <> 0 Then
Do
Say 'Send_Data failed with rc='xlatrxap(appcrc)'.'
Call Appc 'Tp_Ended', tpid
Exit
End
appcrc = Appc('Flush', tpid, convid, 'Mapped')
If appcrc <> 0 Then
Do
Say 'Flush failed with rc='xlatrxap(appcrc)'.'
Call Appc 'Tp_Ended', tpid
Exit
End
End
call rxdestroypipe hread, hwrite
Call Appc 'Deallocate', tpid, convid, 'Mapped', 'Sync_Level'
Call Appc 'Tp_Ended', tpid
Exit
Syntax:
Say 'Command "'cmdstr'"'
Say 'Failed with syntax error ('rc')' ErrorText(rc)
Call Respond_To_Partner
Signal Restart_From_Here
Cryption:
Return BitXor(Arg(1),Copies('ff'x,Length(Arg(1))))