WaitForProcessOutput (open)
Wait for a process to send output
Syntax
LOADLIB "wh::os.whlib";
INTEGER FUNCTION WaitForProcessOutput(INTEGER processid, INTEGER maxwait)
Parameters
INTEGER processid
ID of process to wait for
INTEGER maxwait
Time to wait, in milliseconds (-1 = forever)
Return value
INTEGER
-1 if process not started, 0 for timeout, 1 if there is 'output', 2 if there are 'errors'
Description
This process listens to both the output and error stream for data, if these were 'taken' using StartProcess. If the process has terminated, this function will report the output or errors to be readable. If both output and errors were not 'taken' using StartProcess, this function will simply wait for the process to terminate.