Jump to content

Delphi | Read beyond end of file


klasss

Recommended Posts

Olá,

Estou a tentar recuperar alguma informação de um programa feito em Delphi. Acontece quando tento ver uma lista ocorre o seguinte erro: "Read beyond end of file".

Em modo debug o código anda em torno deste pedaço de código:

 

 assignfile(usersession.ftemp_eime,'D:\EIME_DATA\DATA\'+usersession.nome_fich);
  rewrite(usersession.ftemp_eime);
  assignfile(usersession.f_eime,'D:\EIME_DATA\equipamentos.xxi');
  reset(usersession.f_eime);
  //..... do work...
  if not eof(usersession.f_eime) then
  begin
    while not eof(usersession.f_eime) do
    begin
      read(usersession.f_eime,usersession.eime);
      usersession.passa:=true;

      //estado
      if usersession.eime.estado=4 then usersession.passa:=false;

      if usersession.passa=true then
      begin
         //se está dentro dos parametros, escreve no ficheiro temporario
         usersession.eime.pos_temp:=(filepos(usersession.f_eime)-1);
         write(usersession.ftemp_eime,usersession.eime);
      end;
    end;    // while
  end;

  //FileMode :=fmOpenRead+fmShareDenyNone;
  //..... End Work

  closefile(usersession.f_eime);

  usersession.tamfich:=filesize(usersession.ftemp_eime);

  closefile(usersession.ftemp_eime);

 

Numa situação normal isto iria mostrar uma lista de material numa Grid.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.