[Lazarus] Copy buffer of PWord to TMemoryStream

Sven Barth pascaldragon at googlemail.com
Sun Mar 24 19:25:02 CET 2013


On 24.03.2013 19:24, Mattias Gaertner wrote:
> On Sun, 24 Mar 2013 19:21:49 +0100
> Sven Barth <pascaldragon at googlemail.com> wrote:
>
>> [...]
>>>> Hi, I'm copying a buffer of PWord to a TMemoryStream using this code:
>>>>     inc(lTmpBuff, 1);
>>>>     inc(I, 1);
>>>
>>> What about:
>>>
>>>      inc(lTmpBuff, SizeOf(PWord));
>>>      inc(I, SizeOf(PWord));
>>
>> If lTmpBuff is declared as PWord then "Inc" already increases in
>> multiplies of "SizeOf(PWord)".
>
> I guess, you mean multiples of SizeOf(Word).

Of course :)

Regards,
Sven




More information about the Lazarus mailing list