Hola:
En mi anterior intervenci�n me equivoqu�, por lo que pido disculpas. Hice peque�as pruebitas y funciona perfectamente el FileSize. Adjunto los c�digos de los programitas para crear y para leer el archivo, con uso de FileSize. He comprobado que el archivo tiene que estar abierto para que funcione. Para crear el archivo:
program prueba;
type DatPart = record
a: integer;
b: real;
end;
var DP: DatPart;
fi : file of DatPart;
begin
Assign(fi, 'prueba.prb');
rewrite(fi);
with DP do begin
writeln('a?'); read(a);
writeln('b?'); read(b);
end;
write(fi, DP);
close(fi);
end.
Para leer el archivo:
program prueba02;
type DatPart = record
a: integer;
b: real;
end;
var DP: DatPart;
fi : file of DatPart;
begin
Assign(fi, 'prueba.prb');
reset(fi);
read(fi, DP);
with DP do begin
write('a='); writeln(a);
write('b='); writeln(b);
end;
write('tama�o del archivo = '); writeln(fileSize(fi));
close(fi);
end.
Espero que sirva.
Un saludo.
2011/2/15 Anxo V�zquez <xanxov en esdebian.org>
Show quoted text 39 lines
Hola.
Tengo un problema con la funci�n FileSize que en Pascal se utilizaba para
conocer el tama�o de los archivos tipeados. Se que con Delphi funciona, pero
no lo veo nada claro en Lazarus.
Creo un archivo tipo de nombre DatPart.
type DatPart = record
...........
end;
Creo la variable de archivo.
fi : File Of DatPart;
En cuanto hago uso de ka funci�n.
FileSize( fi );
Parece esperar un AnsiString y recibe una var fichero.
ciflet.pas(206,17) Error: Incompatible type for arg no. 1: Got "File Of
DatPart", expected "AnsiString"
Uso la versi�n 9.28.2-12 en Debian 6.0 Squeeze.
� Alguna idea, por favor ?.
Un saludo.[?]
_______________________________________________
Lazarus-es mailing list
Lazarus-es en lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus-es
------------ pr�xima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus-es/attachments/20110216/c4813bbc/attachment-0001.html> ------------ pr�xima parte ------------
A non-text attachment was scrubbed...
Name: no disponible
Type: image/gif
Size: 100 bytes
Desc: no disponible
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus-es/attachments/20110216/c4813bbc/attachment-0001.gif>