Sign in Join
FPDoc Onlineexperiment

TProcess.RunCommandLoop function

Member of TProcesspublicIn unit Process

Execute command and collect output in strings.

Declaration

pascal
function RunCommandLoop(out outputstring: string; 
 out stderrstring: string; 
 out anexitstatus: Integer): Integer; virtual

Arguments

outputstring

Standard output as a string.

stderrstring

Standard error output as a string.

anexitstatus

Exit status of the process.

Function result

1 on error, 0 on success.

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 OnRunCommandEvent event handler is called during the various stages of the call. If it is not explicitly set, a sleep period specified by RunCommandSleepTime is interjected between the various read calls.

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

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.