View Single Post
Old 02 December 2022, 22:11   #8
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
PS. At the end, I used WaitForPort because it straightforward and it either returns 0 immediately (if the port is available) or timeouts after 10 sec. and returns 5 (if the port is unavailable).

Code:
IF ~SHOW('P', programPort) THEN DO
   ADDRESS Command 'Run >' || tempFile || ' ' || programName
   ADDRESS Command 'WaitForPort ' || programPort
   IF RC ~= 0 THEN DO
      SAY 'Could not start ' || programName || ', is it in the path?'
      EXIT
   END
   SAY programName || ' has started.'
END
ELSE DO
   SAY programName || ' was already started.'
END
tygre is offline  
 
Page generated in 0.04261 seconds with 11 queries