JVCL Help:TJvCreateProcess.OnRead
From Project JEDI Wiki
Jump to navigationJump to searchJVCL Help: TJvCreateProcess.OnRead Event
[+] TJvCreateProcess Events
[+] TJvCreateProcess Methods
[+] TJvCreateProcess Properties
Search in JVCL Help
Search in all projectsSummary
Occurs when a console process created with TJvCreateProcess outputs a line feed (#10) char.
Pascal
TJvCPSReadEvent = procedure (Sender: TObject; const S: string; const StartsOnNewLine: Boolean) ofobject;
propertyOnRead: TJvCPSReadEvent;
Parameters
Parameters | Description |
StartsOnNewLine | Indicates whether parameter S starts on a new line or is on the same line as the last line read. |
S | The data received from the console process. |
Sender | The object that triggered this event. |
Description
Write an OnRead event handler to respond when a console process outputs a new line. The data is pre-processed; thus, it won't contain back space (#8), tab (#9), line feed (#10) or carriage return (#13) chars.
Examples
procedure TForm1.JvCreateProcess1Read(Sender: TObject; const S: string;
const StartsOnNewLine: Boolean);
begin
// C is the Form Feed char.
if S = #$C then
// Clear screen
ListBox1.Clear;
else
if StartsOnNewLine then
// Add new line
ListBox1.Items.Add(S);
else
// Change last line
ListBox1.Items[ListBox1.Count - 1] := S
end;
Note coRedirect must be included in ConsoleOptions, otherwise no OnRead event will be fired.
See Also
TJvCreateProcess.ConsoleOptions, TJvCreateProcess.ConsoleOutput, TJvCreateProcess.OnRawRead
About
Contribute to this help topic
This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page