----- Original Message ----- From: "German C. Basisty" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, July 17, 2007 7:46 PM
Subject: [lazarus] files: I give up


Now I really dont know whats wrong, please help me.



The writting code:



========================================

procedure TForm1.Button1Click(Sender: TObject);

var

 archivo: File of String;

 cadena: String;



begin

 cadena := Edit1.Text;

 ShowMessage(cadena);

 System.Assign(archivo, 'archivo.dat');

 System.Rewrite(archivo);

 Write(archivo, cadena);

 System.Close(archivo);

end;

========================================



The Reading code (Another app):



========================================

procedure TForm1.Button1Click(Sender: TObject);

var

 archivo: file of string;

 cadena: string;



begin

 System.Assign(archivo, 'archivo.dat');

 System.Reset(archivo);

 read(archivo, cadena);

 System.Close(archivo);



 Edit1.Text := cadena;



end;

========================================



When I run the writting app, it seems to work, the archivo.dat file is
created. But when I run the Reading app, and press the read button, it
apperas an error message who say something about Access violation.



Please help! Have mercy!!!!



Regards,



German



It looks like you speak spanish, if you want, see me in the #lazarus-es IRC channel in freenode, everybody is invited btw.

Jesus Reyes A.
_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to