jPV wrote:
In any case it would be better if there would be a dedicated function to check the ports. It would be a clean solution to check which other programs are available if you have several options to interact with, and it's a good practise to check availability before sending lots of ARexx commands somewhere and then wonder the results. But I guess I can live with that RunRexxScript workaround...
The problem is that you are in a multitasking environment so even if there was a function like PortExists() it would still be unreliable because the port can go away at any time. So PortExists() could return TRUE and SendRexxCommand() could still fail because the program has been closed in the meantime. Well, I'll think about it ... maybe I'll add such a function for a future version. Wouldn't be much of a problem but it will always be unreliable because of the multitasking environment.
No, I planned to do the serious stuff with Hollywood and just utilize the ports/commands on other programs

Just like I do with Lua... I like to keep with one language at time and there's no need to mess more with the actual ARexx language if you just want to utilize what some programs offer through the port.
But 99% of the people have rexxsyslib.library anyway on MorphOS
But I can't get the result like that no matter which programs I try it with and it looks that it never return the results of the sent commands.
I found a workaround to that by injecting couple of other ARexx commands with the actual command, but it kind of kills the elegancy of the SendRexxCommand...
So, it doesn't work like written in the manual...
Right, I can confirm this behaviour. But I'm not sure whether this is a bug or a feature because all my knowledge of ARexx has pretty much vanished. I never was an ARexx guy. I just read up on it when I wrote the Hollywood ARexx library which must have been in 2006 or so. But since then I've almost forgotten everything about Rexx

The only thing I remember was that the implementation had to be done quite carefully and that the whole thing was quite fragile and not everything was documented so I'm very reluctant to touch anything here unless it's proven to be a bug...
Looking at your code I could of course extend SendRexxCommand() to always extend the command in the way you did. So if your script does
then SendRexxCommand() could be modified to do this instead:
Code: Select all
SendRexxCommand("XXX", "OPTIONS RESULTS;CMD;RETURN RESULT")
But I'm not sure if there are any implications, e.g. for commands which don't return anything. Additionally, it would also break compatibility with older scripts which might expect the old behaviour which is of course a no go since keeping compatibility always is of a very high priority. But the main problem is really my vanished knowledge of ARexx. That's why I'm pretty much unable to judge what would be the best way to do it. But I must have had some reason why I implemented it the way I did it... but I don't remember them :/