title: TProcess - Catching output from several Process.Input.Write(...) commands
body: <p>I want chess engine to analyze some game in pgn format.</p>
  
  <p>Till now I have.</p>
  
  <pre><code>begin
  // ...
  P:=TProcess.Create(nil);
  stL:=TStringList.create;
  P.Commandline:='Houdini'; // &lt;- this is chess engine, Houdini.exe
  P.Options:=P.Options+[poUsePipes];
  P.ShowWindow:=swoHide;
  P.Execute;
  
  st:='uci'+ Lineending;
  P.Input.Write(st[1], Length(st));
  // st:=P.Output.ReadAnsiString;    &lt;- this is my try
  // showmessage(st);
  st:='setoption name multipv value 3'+lineending;
  P.Input.Write(st[1], Length(st)); // so after second command how to catch different output
  st:='isready'+lineending;
  P.Input.Write(st[1], Length(st));
  st:='ucinewgame'+lineending;
  P.Input.Write(st[1], Length(st));
  st:='isready'+lineending;
  P.Input.Write(st[1], Length(st));
  
  // another part of code should be here ***
  
  st:='quit'+lineending;
  P.Input.Write(st[1], Length(st)); // quiting the engine
  stL.LoadFromStream(P.Output);
  stL.SaveToFile('AjDaVidime.txt');  // nothing stores particular
  
  P.Free;
  stL.Free; 
  end;
  </code></pre>
  
  <p>So question is how to get output from engine output after every P.Input.Write...</p>
  
  <p>Another part of code follows (this is for strange  stackoverflow behaviour to post my question.
  This code should be in first one in <em>*</em></p>
  
  <pre><code>// This for loop is main loop for analyzing chess game
  for i:=1 to moves do begin
   st:='position fen '+arrayFen[i]+lineending;
   P.Input.Write(st[1], Length(st));
   st:='go movetime 1000'+lineending;  // Fen is position 1000ms is 1sec, so engine Must analyze 1 sec. that position, so go movetime 1000 is command.
   P.Input.Write(st[1], Length(st));
   Sleep(1000); // &lt;- is this neccessary?
  end; 
  </code></pre>