SendRexxCommand does not return result
Posted: Sun May 31, 2020 5:19 pm
When using SendRexxCommand no result is returned.
Using a simple ARexx Script works fine.
Tested on AmigaOS 3.1.4.1 and MorphOS 3.13
Server:
Client:
ARexx test script:
Using a simple ARexx Script works fine.
Tested on AmigaOS 3.1.4.1 and MorphOS 3.13
Server:
Code: Select all
@VERSION 8,0
Function p_EventFunc(msg)
Switch msg.action
Case "OnARexx"
Switch msg.command
Case "EXIT"
DebugPrint("Exit received! Quitting now.")
End
Case "GETSTRING"
DebugPrint("GetString called")
Return("GETSTRING called")
Case "GETNUMBER"
DebugPrint("GeNumber called")
Return(10)
Default
Local t = SplitStr(msg.args, "\0")
DebugPrint(msg.command, "called with", msg.argc, "argument(s)")
For Local k = 1 To msg.argc
Return("Argument " .. k .. ":" .. t[k - 1])
Next
EndSwitch
EndSwitch
EndFunction
CreateRexxPort("MYCOOLPORT")
InstallEventHandler({OnARexx = p_EventFunc})
Repeat
WaitEvent
Forever
End
Code: Select all
@VERSION 8,0
res$ = SendRexxCommand("MYCOOLPORT","GETSTRING")
DebugPrint("Result: " .. res$)
res$ = SendRexxCommand("MYCOOLPORT","GETNUMBER")
DebugPrint("Result: " .. res$)
res$ = SendRexxCommand("MYCOOLPORT","SOMETHING 'SOMEARGUMENT'")
DebugPrint("Result: " .. res$)
Code: Select all
/* remember the first line of every Rexx script must be a comment */
OPTIONS RESULTS
/* the port of our Hollywood script is now the host */
ADDRESS MYCOOLPORT
GETSTRING
SAY RESULT
GETNUMBER
SAY RESULT
SOMETHING "SomeArgument"
SAY RESULT