Contents | Index | < Browse | Browse >
WaitForPort <port>
Pauses 10 seconds or until the named <port> is available on the system. If
the port is not available after 10 seconds, the command will set a return
code of 5.
Applications that support ARexx open a port with a name specified by the
application's developer. The port name should be detailed in the
documentation. Port names are case sensitive, so that 'TurboText1' is not
the same name as 'TURBOTEXT1'. WAITFORPORT lets a script pause while a
program is loaded by the system since the port will not be added until the
application is ready to receive input.
The following fragment shows how the command is used to wait while the
terminal program VLT is loaded:
/**/
/* SHOW() can be used to check for the existence of a port */
if ~show('P', 'VLT') then do
address command /* both RUN and WAITFORPORT are DOS commands. */
'run >nil: vlt:VLT'
/*
The loop below assures that the program will wait at least 50
seconds for the port to open, but will exit as soon as the port
is available.
*/
do 5 while ~show('P', 'VLT')
'waitforport VLT'
end
address
/*
The return code RC is set to 5 when WaitForPort times out
before the port is available.
*/
if rc = 5 then do
say 'Unable to load VLT'
exit
end
end
WAITFORPORT is not an ARexx command or function. It is a DOS command much
like 'list' or 'cd' and should be treated the same way in scripts. A
common error is to issue the command to the wrong environment. The
instruction { ADDRESS COMMAND } may have to be issued to assure that the
command is sent to AmigaDOS.
Next: Command utilities | Prev: TE | Contents: Command utilities