Link to home
Create AccountLog in
Delphi

Delphi

--

Questions

--

Followers

Top Experts

Avatar of cvbn
cvbn

EFOpenError
EFOpenError

Hi, I'm using :

function GetTextFromFile(AFile: string; var Returnstring: string): Boolean;
var
  FileStream: TFileStream;
begin
  Result := False;
  if not FileExists(AFile) then Exit;
  FileStream := TFileStream.Create(AFile, fmOpenRead);
  try
    if FileStream.Size <> 0 then
    begin
      SetLength(Returnstring, FileStream.Size);
      FileStream.Read(Returnstring[1], FileStream.Size);
      Result := True;
    end;
  finally
    FileStream.Free;
  end;
end;

Example :

procedure TForm1.Button1Click(Sender: TObject);
begin
GetTextFromFile(FILELISTBOX1.FileName,Edit1.Text);
end;

How to read FILES ON EFOpenError "Cannot open file ..." ?

Thank You.

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of MerijnBMerijnB🇳🇱

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Delphi

Delphi

--

Questions

--

Followers

Top Experts

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.