[Lazarus] Use of Move()?

Burkhard Carstens fpc at bcsoft.de
Tue Feb 1 21:18:57 CET 2011


Am Dienstag, 1. Februar 2011 21:03 schrieb Bo Berglund:
> I think I have made an error.....
> I have created a generalized buffer handler for my project and here I
> have this function to read data from the buffer.
>
> function TSSCommBuf.Read(Dest: Pointer; Count: Cardinal): Cardinal;
> var
>   num: Cardinal;
> begin
>   num := FWriteIndex - FReadIndex;  //Remaining data bytes in buffer
>   if num >= Count then
>     num := Count;
>   if num > 0 then
>   begin
>     Move(FBuf[FReadIndex], Dest, num);

didn't read further, but: try Dest^ ..
(quick guess)

regards
 Burkhard





More information about the Lazarus mailing list