TProcess output to a TMemo lazarus / 62-General ---------------------------------------------------------------------- Dzandaa · 2021-08-04 18:33 Hi, Is it possible to write the output (String) of a TProcess in a TMemo Line by Line? Thank you. ---------------------------------------------------------------------- winni · 2021-08-04 19:26 Hi! I don't understand the reason of this question, but: You can assign your output string to a temporay stringlist and add the lines one by one: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ...tmpStringList := TStringList.create;tmpStringList.text := OutputString; for i := 0 to tmpStringList.count - 1 do    memo1.lines.add (tmpStringList[i]);tmpStringList.free;... Winni ---------------------------------------------------------------------- Edson · 2021-08-04 20:01 I would recommend https://github.com/t-edson/UnTerminal It's a wrapper for a wrapper for TProcess with prompt detection and event driven. ---------------------------------------------------------------------- Jurassic Pork · 2021-08-04 22:42 hello, Quote from: Dzandaa on August 04, 2021, 08:33:23 pmIs 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 : é ) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i 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 promptend;               Friendly, J.P ---------------------------------------------------------------------- Dzandaa · 2021-08-05 12:16 Thank you very much. I've try it and it work in linux C++ using cout, just have to add cout.flush() after each output. ---------------------------------------------------------------------- Edson · 2021-08-05 18:31 Quote from: Jurassic Pork on August 05, 2021, 12:42:00 amEdson -> I have modified your example because On Windows Strings must be converted from OEM to UTF8  (for latin characters ex : é ) Not problem. It's a good contribution. I realize I need to complete some translations to English  .