#ARexx Shell Myster
3 messages in this thread
To all
I have run into a problem that I don't understand why it is occuring.
Arexx script that runs fine from Wshell but when run from a Amigashell it
has a problem unless I change one line of the script.
Here is the section of the script that runs from Wshell.
address command 'run ram:Edplayer'
waitforport Edplayer
address Edplayer 'Load ram:circus.mod'
adrress command 'wait 5'
address Edplayer 'Play'
When I run this from a Amigashell I get a 'host environment not found'.
Even though the script has run Edplayer and its port is open.
Now when I take the first line of the script and break it into two lines
address command
'run ram:Edplayer'
It runs ok from a Amigashell or Wshell.
Why should this occur? Inquiring mind wants to understand.
The problem with your script is that the waitforport command must be run as
a DOS command, not issued to the default host address. In the case that
the script is run from WShell, waitforport gets run by the parent shell and
all works well. But when run from an AmigaShell, the waitforport command
gets sent to ARexx, and nothing happens since it isn't an ARexx command.
Since no wait occurs, the EdPlayer host doesn't have time to come up, and
the address EdPlayer instruction then fails.
I'd recommend that you simply test whether a WShell is running the script
and then issue an address command if it isn't. Try for example
if left(address(),4) ~== 'WSH_' then address command
at the beginning of your script. Then the default host will be either a
WSHell or address command, and you can issue the DOS commands directly
without an address instruction.
Hope this clears up the confusion …
Bill Hawes
Thanks for the info.