FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Ayuda con archivos binarios usando TFileStream
Hola Necesito hacer el un porgrama donde guarde en un archivo binario mediante TFileStream la posicion en donde esta quedo por ultimas ves la ventana, y el ancho y largo de la misma, pero al codificarlo me da el siguiente error:
[Pascal Error] Ejercicio3.pas(41): E2036 Variable required [Pascal Error] Ejercicio3.pas(42): E2036 Variable required [Pascal Error] Ejercicio3.pas(65): E2197 Constant object cannot be passed as var parameter [Pascal Error] Ejercicio3.pas(66): E2197 Constant object cannot be passed as var parameter [Pascal Error] Ejercicio3.pas(67): E2197 Constant object cannot be passed as var parameter [Pascal Error] Ejercicio3.pas(68): E2197 Constant object cannot be passed as var parameter [Pascal Fatal Error] Project1.dpr(5): F2063 Could not compile used unit 'Ejercicio3.pas' Les agradeceria mucho si me dicen como hacer para usar bien archivos binarios en este programa.Muchas Gracias El codigo es el siguiente: Código:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); var Ini : TiniFile; Binario : TFileStream; begin //Con Archivo Ini // Ini := TiniFile.Create(ExtractFilePath(Application.ExeName) + 'Config.ini'); //Ini.WriteInteger('DIMESION','Ancho',Width); //Ini.WriteInteger('DIMESION','Alto',Height); //Ini.WriteInteger('Posicion','Izquierdo',Left); //Ini.WriteInteger('Posicion','Superior',top); //Ini.free; //Con Archivo Binario Binario := TFileStream.Create(ExtractFilePath(Application.ExeName) + 'Config.dat',fmCreate); Binario.Write(Left,sizeof(integer)); Binario.Write(Top,sizeof(integer)); Binario.Write(Width,sizeof(integer)); Binario.Write(Height,sizeof(integer)); Binario.Free; end; procedure TForm1.FormCreate(Sender: TObject); var Ini : TiniFile; Binario : TFileStream; begin //Con Archivo Ini //Ini := TiniFile.Create(ExtractFilePath(Application.ExeName) + 'Config.ini'); //Width := Ini.ReadInteger('DIMESION','Ancho',0); //Height := Ini.ReadInteger('DIMESION','Alto',0); //Left := Ini.ReadInteger('Posicion','Izquierdo',0); //Top := Ini.ReadInteger('Posicion','Superior',0); //Ini.free; //Con Archivo Binario Binario := TFileStream.Create(ExtractFilePath(Application.ExeName) + 'Config.dat',fmOpenRead); while Binario.Position < Binario.Size do begin Left := Binario.Read(Left ,sizeof(integer)); Top := Binario.Read(Top ,sizeof(integer)); Width :=Binario.Read(Width ,sizeof(integer)); Height := Binario.Read(Height ,sizeof(integer)); end; Binario.Free; end; |
#2
|
||||
|
||||
Hola Eze32 , bienvenido a Club Delphi
Como a todos los ingresan te invitamos a que leas nuestra guía de estilo.
Saludos. Edito: ¿ No te resulta mas sencillo hacerlo con el registro de windows ?
__________________
Daniel Didriksen Guía de estilo - Uso de las etiquetas - La otra guía de estilo .... Última edición por ecfisa fecha: 31-05-2013 a las 17:22:32. |
#3
|
|||
|
|||
Gracias por la respuesta me sirvio mucho la ayuda.
|
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Manejo de Archivos con TFileStream | nlsgarcia | Varios | 6 | 02-09-2011 02:26:36 |
Necesito ayuda con el manejo de archivos usando delphi 7 | mauser1985 | Impresión | 40 | 14-07-2008 00:14:00 |
Necesito ayuda con el manejo de archivos usando delphi 7 | mauser1985 | Varios | 1 | 13-07-2008 00:08:44 |
archivos binarios | kazcote | Varios | 5 | 05-12-2005 04:02:35 |
ayuda programa con archivos binarios | nahuel | Varios | 4 | 25-01-2004 17:55:20 |
|