[Lazarus-es] Problema con archivos

JoshyFun joshyfun en gmail.com
Jue Oct 29 00:35:17 CET 2009


Hello Hetor,

Wednesday, October 28, 2009, 11:58:08 PM, you wrote:

HSP> En el codigo:        ReadLn(f, s);     // aca da el error*

[...]

Prueba cambiando esto:

   Function get_firstline(fname: string): string;
   var
     f: TextFile;
     s: String;
   begin
     if FileExists(fname) then
     begin
       AssignFile(f, fname);
       Reset(f);

       ReadLn(f, s);     // aca da el error

       result:=s;
       CloseFile(f);
     end;
   end;

por esto otro:

   Function get_firstline(fname: string): string;
   var
     fi: TextFile;
     si: String;
   begin
     if FileExists(fname) then
     begin
       AssignFile(fi, fname);
       Reset(fi);

       ReadLn(fi, si);     // aca da el error

       result:=si;
       CloseFile(fi);
     end;
   end;

Si así funciona por favor avisa por que sería un bug y comprobaría si
está corregido en fpc 2.5.1

-- 
Best regards,
 JoshyFun





More information about the Lazarus-es mailing list