/*
 * RunMUIrexx
 *
 * USAGE: portname = 'mui/RunMUIrexx'(port_basename,help_file)
 *
 * RunMUIrexx launchs a new MUIrexx process into background and return the
 * ARexx port name opened...
 *
 * $(C): (1996, Rocco Coluccelli, Bologna)
 * $VER: RunMUIrexx 0.03 (13.Nov.1996)
 */

PARSE ARG basename,helpfile
IF basename = "" THEN RETURN ""

DO n = 1 UNTIL ~SHOW('P',basename"."n); END; port = basename"."n

ADDRESS COMMAND
cmd = 'Run >NIL: MuiRexx PORT' port
IF helpfile ~= "" THEN cmd 'HELP' helpfile; ELSE cmd
'WaitForPort' port

IF SHOW('P',port) THEN RETURN port

RETURN ""

