Dave Coventry wrote:
> If I Blockread(F,buffer,4) with buffer being an array of byte, Is
> there a routine in fpc/lazarus which will revers the bytes for me?
>
> This is what I want:
> longv:=buffer[0];
> longv+=buffer[1] shl 8;
> longv+=buffer[2] shl 16;
> longv+=buffer[3] shl 24;
>
> Is there a function which does this for me?
> _______________________________________________
>   
Yes. See LEtoN, BEtoN, NtoLE and NtoBE.

BlockRead(F, FooLongInt, 4);

FooLongInt := LEtoN(FooLongInt);

Regards,

Andrew
_______________________________________________
Lazarus mailing list
[email protected]
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to