/* Eagleplayer control using DOPUS 4
   (c) 1992-97 DEFECT Softworks

   starts Eagleplayer if not active yet

   usage:
   [Arexx] Eagleplayer2:rexx/EP_LoadEagleplayer.dopus {p}
*/
options results

parse arg opusport

Waittime = 60						/* 1 min wait */

if pos('rexx_EP',SHOW('Ports')) ~= 0 then
 do
  address value opusport
  toptext 'Eagleplayer already in Memory!'
 exit
 end

 /* Eagleplayer laden */

 address COMMAND 'run >nil: Eagleplayer2:Eagleplayer'

testflag=0
time ('R')

address value opusport
toptext 'Waiting for Eagleplayer'

do while (testflag=0) & (time('E') < Waittime)
 if (pos('rexx_EP',SHOW('Ports')) ~= 0) then testflag =1
end

if pos('rexx_EP',SHOW('Ports')) ~= 0 then
 toptext 'Eagleplayer ready'
 else
 toptext 'Couldn`t load Eagleplayer!'
exit
