Skip to content

TProcess.RunCommandLoop

Execute command and collect output in strings.

Declaration

Source position: processbody.inc line 200

public 
function TProcess.RunCommandLoop(out outputstring: string; 
                                out stderrstring: string; 
                                out anexitstatus: Integer) : Integer
                                ;  virtual;

Description

RunCommandLoop executes the command, and runs a loop to read output of the command: the output of the command is returned in the outputstring parameter, and the error output is returned in the stderrstring string.

During collection of data or on error, the TProcess.OnRunCommandEvent event handler is called during the various stages of the call. If it is not explicitly set, a sleep period specified by TProcess.RunCommandSleepTime is interjected between the various read calls.

The return value of this call is 1 for error, zero for success.

See also

Name Description
TProcess.OnRunCommandEvent Event handler, called when RunCommandLoop is executing.
TProcess.RunCommandSleepTime Sleep time between attempts to collect data.