res$ = SendRexxCommand(port$, cmd$)
cmd$
to the Rexx port
specified in port$
. The function will then return the result from the
command. The return value will always be a string - even if it contains
just a number. If the command does not return anything, you will
receive an empty string. You can also send multiple commands with this
function. Just separate the statements with ";" or you can also use new
line characters ("\n") for separation.
If you do not want to address a specific Rexx port, simply pass "REXX"
in port$
. In that case, the system's standard ARexx port will be your
host port. Please also remember that port names are case sensitive, i.e.
"MYPORT" and "myport" denote two different Rexx ports. For style guide
reasons, port names are usually in upper case only.
You have to start RexxMast prior to using this function. It is, however, not necessary to create a Rexx port in order to use this function. This function works also if your script does not have a Rexx port.
SendRexxCommand("WORKBENCH", "WINDOW 'Sys:' OPEN")The above code will open the SYS: drawer on your Workbench. Please note that the ARexx interface of the Workbench is a feature introduced in OS3.5. Thus, you will require OS3.5 or better. MorphOS does probably not support the Workbench ARexx interface because it is only rarely used. See the OS3.9 NDK for documentation on the available commands.