[Overview][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'process' (#fcl)

# TPROCESS.RunCommandLoop

Execute command and collect output in strings

## Declaration

Source position: processbody.inc line 124

`public function TPROCESS.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 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

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

Documentation generated on: May 14 2021