[Lazarus] Copy buffer of PWord to TMemoryStream

Leonardo M. Ramé l.rame at griensu.com
Sun Mar 24 19:21:49 CET 2013


On 2013-03-24 15:19:11 -0300, Joao Morais wrote:
> 2013/3/24 Leonardo M. Ramé <l.rame at griensu.com>:
> > Hi, I'm copying a buffer of PWord to a TMemoryStream using this code:
> >
> > lTmpBuff := lBuffer;
> > I := 0;
> > while I < lBufSize do
> > begin
> >   lStream.Write(lTmpBuff^, SizeOf(PWord));
> >   inc(lTmpBuff, 1);
> >   inc(I, 1);
> 
> What about:
> 
>    inc(lTmpBuff, SizeOf(PWord));
>    inc(I, SizeOf(PWord));
> 

I've already tried that, but the only way it works is incrementing by
just 1.

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com




More information about the Lazarus mailing list