[fpc-pascal] Adding a array of float in ressource and use it ?

Michael Van Canneyt michael at freepascal.org
Mon Mar 6 13:11:24 CET 2017



On Mon, 6 Mar 2017, fredvs wrote:

> Hello Michael and thanks for answer.
>
>> You must write
>>  FileBuffer.Data.WriteBuffer(buffer[0],Length(Buffer)*Sizeof(Float)); 
>
> Ha, perfect, many thanks.
>
> But there is something that I do not catch, why is it working for integer ?
>
> Sizeof Integer is 2 bits so, normally:
>
> FileBuffer.Data.WriteBuffer(buffer[0],Length(Buffer)); 
>
> should not work (but it works) ---> Length(Buffer) = 1/2 * 
> Length(Buffer)*Sizeof(integer)

I don't know. By all logic, it should not work either.

Michael.



More information about the fpc-pascal mailing list