Simply write in a Text File, Execute a Programm, get Result by reading from Text lazarus / 61-Beginners ---------------------------------------------------------------------- Weitentaaal · 2021-01-29 09:43 Hello Guys so i Have this Error "File not open" but i cant figure out why the File isn't open. Can Some1 help ? 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  Procedure TBereSD.Black_LBF(prechtl: Boolean);Var   ITSDCalcFile : TextFile;   Bb : TProcess;Begin   Bb := TProcess.Create(Nil);    try      AssignFile(ITSDCalcFile, 'C:\WGKBlck\LBF\ITSDIN.TXT');      {$I-} // without this, if rewrite fails then a runtime error will be generated      Rewrite(ITSDCalcFile);      {$I+}      if IOResult =0 then begin // OK, we can write the file         WriteLn('Sample String');   // Getting the Error here: File not Open         //.. Some other operations with more WriteLN's         Bb.Executable:=('C:\WGKBlck\Lbf\ITSDCalc43.EXE');        Bb.Parameters.Add('ITSDIN.TXT');        Bb.Parameters.Add('ITSDOUT.TXT');         Bb.Execute;        //Ergebniss auswerten      end else begin         WriteLn('error opening file for writing');      end;   finally      CloseFile(ITSDCalcFile);      Bb.Free;   end;    Zeile := ReadFileToString('C:\WGKBlck\LBF\ITSDOUT.TXT');   ShowMessage(Zeile)    //.. Work With "Zeile" End; ---------------------------------------------------------------------- marcov · 2021-01-29 09:54 You close when open failed? ---------------------------------------------------------------------- Weitentaaal · 2021-01-29 10:06 Sh*t did't thought about this Sorry  Corretcted it But still don't lnow why i get The Error .. i Pretty Sure everything is ok. is There something wrong with the path ? or The do i use any Procedure the Wrong way ? Edit: Worked with WriteLN(ITSDCalcFile, 'Data') ---------------------------------------------------------------------- ASerge · 2021-01-29 13:24 And don't forget that the try finally block should start after opening the file (after Rewrite), not before that, so as not to make closing an unopened file.