Reference TExternalCommand
Declared in Codebot.Process.pas on line 33
TExternalCommand provides a simplified way to run external programs where you want to record their output and detect when they have completed
TExternalCommand = class(TComponent)
public
{ Create a new external command }
constructor Create(AOwner: TComponent); override;
{ Kill the program if it is running and destroy the command }
destructor Destroy; override;
{ Run begins execution of the external program }
procedure Run;
{ Kill aborts execution of the external program }
procedure Kill;
{ Output contains all lines read from the program }
property Output: TStrings read FOutput;
{ Running is true while the external program is executing }
property Running: Boolean read FRunning;
published
{ The file name of the external program to execute }
property Command: string read FCommand write FCommand;
{ Any command line arguments provided to the above program }
property Arguments: TStrings read FArguments write SetArguments;
{ When BufferOutput is true all lines read are stored in the output property }
property BufferOutput: Boolean read FBufferOutput write FBufferOutput default True;
{ OnLineRead is fired each time a complete line is read from the running
program }
property OnLineRead: TLineReadEvent read FOnLineRead write FOnLineRead;
{ OnComplete is fired when the program completes }
property OnComplete: TNotifyEvent read FOnComplete write FOnComplete;
end;