hello,
Is it possible to write the output (String) of a TProcess in a TMemo Line by Line?.
what do you mean for that ? send the stdout and stderr of the process in real time to the tmemo while process is running ?
with UnTerminal you can do that -> see attachment ( Example 2 of UnTerminal)
Edson -> I have modified your example because On Windows Strings must be converted from OEM to UTF8 (for latin characters ex : é )
uses LazUTF8;
// ....
procedure TForm1.procLineCompleted(const lin: string);
begin
if LinPartial then begin
//Estamos en la línea del prompt
Memo1.Lines[Memo1.Lines.Count-1] := ConsoleToUTF8(lin); //reemplaza última línea
LinPartial := false;
end else begin //caso común
Memo1.Lines.Add(ConsoleToUTF8(lin));
end;
end;
procedure TForm1.procReadData(nDat: integer; const lastLin: string);
begin
LinPartial := true; //marca bandera
Memo1.Lines.Add(ConsoleToUTF8(lastLin)); //agrega la línea que contiene al prompt
end;
Friendly, J.P