[fpc-pascal] dynamic array contents and system.move

David Emerson dle3ab at angelbase.com
Sat Apr 24 22:01:18 CEST 2010


cobines wrote:
> David Emerson wrote:
> > move (src.f_data, self.f_data, length(self.f_data) * sizeof(byte));
> 
> I think it should be:
> 
> SetLength(self.f_data, length(src.f_data));
> move (src.f_data[0], self.f_data[0], length(self.f_data) * sizeof(byte));

Well, the setlength is not necessary, and very nearly prevented me from noticing 
the real solution here, f_data[0] -- thanks very much, it is working now.
(I have this feeling like I have asked this question before. d'oh.)

~David.




More information about the fpc-pascal mailing list